Most excellent monks-

I am trying to write a simple CGI program that will use the Image::Size module to display a given image’s dimensions to the user.

I have checked the archives using super-search and even though my code is basically the same as this code, I am still getting an error. Can someone please tell me what I am doing wrong here?

Thank you for your help,

-mox

PS: I checked, and yes all three modules are installed on my server.

#!/usr/bin/perl use strict; use warnings; use CGI; use LWP::Simple qw(get); use Image::Size qw(imgsize); my $url = 'A STRING TAKEN FROM PATH_INFO'; my $img = get($url); my ($width, $height) = imgsize(\$img); print "$url is ${width}x${height}\n"; my $q = new CGI; # create new CGI print $q->header, $q->start_html('Image measuring'), $q->('The size of your image is:'), $q->("$url is {$x}x{$y}\n"), $q->end_html;

UPDATE: For some reason beyond this humble monk's understanding, the cgi is now working. Thank you for your time and thoughts.


In reply to Using LWP and Image::Size to measure an image... by chinamox

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.