Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^5: Use of uninitialized value $pic

by zentara (Archbishop)
on Apr 25, 2017 at 13:51 UTC ( #1188848=note: print w/replies, xml ) Need Help??

in reply to Re^4: Use of uninitialized value $pic
in thread Use of uninitialized value $pic

Hi, just a thought. Shouldn't
$iutImage->Read(@_); # get the image under test (iut)
my $x = $iutImage->ReadImage($_[0]); warn "$x" if "$x";
Also, you can try passing \$pic to pass the object by reference.

I'm not really a human, but I play one on earth. ..... an animated JAPH

Replies are listed 'Best First'.
Re^6: Use of uninitialized value $pic
by dazz (Sexton) on May 01, 2017 at 10:58 UTC
    I don't know. What does this do:
    warn "$x" if "$x";
    Google tells me it's a warning. Undef??


      It's a very ugly hack for error checking. See "Handling Exceptions" in the documentation of Image::Magick. Sane error handling would use die or the XS equivalent of die inside the Image::Magick code, but now it's too late for an incompatible change.


      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        This is running on a headless system. Does that mean I should use:
        my $iutImage = $_[0]->Clone(); warn "$x" if !ref($x); # print the error message $x =~ /(\d+)/; syslog(LOG_ERR, "Attempt to clone image failed. Error: $1"); # log + the error number

        If the "warn" command sends error messages to the terminal, how do I send those messages to syslog??

        Never too late for a compatible change 😊 deja vu

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1188848]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2020-10-20 21:11 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (210 votes). Check out past polls.