WWW::Me...e::Image(3)

πŸ’… WWW::Mechanize::Image(3) β€” like, the whole page, bestie

okay so real quick: this is the manual page for WWW::Mechanize::Image, which lives in the User Contributed Perl Documentation corner of the world, and today we're reading it together. grab a lil snack, it's short and it's cute πŸ“


✨ NAME ✨

WWW::Mechanize::Image β€” it's the Image object for WWW::Mechanize. that's it, that's the vibe. an object whose whole personality is "i hold image stuff for Mech" πŸŽ€

🌸 VERSION 🌸

version 2.19. yes ma'am, we're on 2.19, write it down πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

it's an Image object that encapsulates all the stuff that Mech needs. lowkey self-explanatory but the docs said it so i'm saying it ✨

🧚 Constructor

new()

creates and returns a brand-new WWW::Mechanize::Image object. she's fresh out the box, no cap πŸ’…

my $image = WWW::Mechanize::Image->new( {
    url    => $url,
    base   => $base,
    tag    => $tag,
    name   => $name,     # From the INPUT tag
    height => $height,   # optional
    width  => $width,    # optional
    alt    => $alt,      # optional
    attrs  => $attr_ref, # optional
} );

those last four are optional, the rest are just… there. iykyk πŸ’œ

πŸ‘‘ Accessors

the getter girlies. one bullet each, no skipping, we love a complete list 🌈

  • $image->url() β€” the image URL, pulled straight from the src attribute of the source tag. heads up though: it may be undef if the source tag has no src attribute. so like, don't assume, mmkay? πŸ™ˆ
  • $image->base() β€” the base URL that the links are relative to.
  • $image->name() β€” the name for the field, from the NAME attribute, if there even is one.
  • $image->tag() β€” the tag name. it's either image or input. those are the two options, periodt.
  • $image->height() β€” the image height πŸ“
  • $image->width() β€” the image width πŸ“
  • $image->alt() β€” the ALT attribute from the source tag, if any. accessibility icon behavior honestly 🫢
  • $image->attrs() β€” a hash ref with all the attributes and attribute values in the tag. the whole ensemble, not just the fit πŸ’€
  • $image->URI() β€” returns the URL as a URI::URL object. glow-up into a real object ✨
  • $image->url_abs() β€” returns the URL as an absolute URL string. no relatives allowed, we're going absolute πŸ”₯

πŸŽ€ SEE ALSO πŸŽ€

go check out WWW::Mechanize and WWW::Mechanize::Link β€” the friend group this one rolls with πŸ¦‹

πŸ’– AUTHOR πŸ’–

Andy Lester <andy at petdance.com> β€” thank you for your service, king πŸ‘‘

This software is copyright (c) 2004 by Andy Lester.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, free free, fr fr πŸ’œ


and that's the whole page bestie πŸ₯Ή before you go: this was the WWW::Mechanize::Image(3) page as shipped with perl v5.42.0, dated 2024-09-17, and it's literally giving "User Contributed Perl Documentation." slay, go write some Perl πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from