in reply to Use of uninitialized value $pic
Well, the Image::Grab doesn't seem to provide any way to retrieve the error message. That's inconvenient. The documentation does indicate that you may use LWP::Simple if you're only using the base features.
$snapshot-> url( "IPCamera{$key}"); looks very suspicious. If you want to be sure of what the argument to a call is, put it in a temporary variable and use that variable twice (for printing and in the call). The reason for using a temporary variable is that if the value is a more complex expression, you might not type twice the same thing, or you may change one and forget the other. With a temp variable and strict, you're sure that what you see is what you get.
my $url = "IPCamera{$key}"; print "Trying to read from $url\n"; $snapshot-> url($url);
|
---|