dazz has asked for the wisdom of the Perl Monks concerning the following question:
The debug output is as follows:my $snapshot = new Image::Grab; $snapshot->ua->timeout(5); # define the timeout for grabbing + an image. Default is 180 sec$ $snapshot-> url( "IPCamera{$key}"); #define the source of the image $snapshot->grab; #grab an image mark_blob(my $pic); $pic = $snapshot->image; #debug my $SaveFile = join("","$ImagePath{$key}",×tamp,"\-snapshot\-$key +.jpg"); print ("Save filename: $SaveFile"); open(my $fh, ">$SaveFile") || die "$SaveFile: $!"; binmode $fh; # for MSDOS derivations. print $fh $pic; close $fh;
DB<1> c 42 main::(grab-images.pl:42): mark_blob(my $pic); DB<2> n main::(grab-images.pl:43): $pic = $snapshot->image; #debug DB<2> main::(grab-images.pl:45): my $SaveFile = join("","$ImagePath{$ke +y}",×tamp,"\-snapshot\-$key.jpg"); DB<2> main::(grab-images.pl:46): print ("Save filename: $SaveFile"); DB<2> main::(grab-images.pl:48): open(my $fh, ">$SaveFile") || die "$Sa +veFile: $!"; DB<2> Save filename: /var/images/trackcam1/2017-04-23_20:40:01-snaps +hot-1.jpg main::(grab-images.pl:49): binmode $fh; # for MSDOS derivations. DB<2> main::(grab-images.pl:50): print $fh $pic; DB<2> s Use of uninitialized value $pic in print at grab-images.pl line 50. at grab-images.pl line 50. main::(grab-images.pl:51): close $fh;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Use of uninitialized value $pic
by Eily (Monsignor) on Apr 24, 2017 at 09:29 UTC | |
Re: Use of uninitialized value $pic
by dazz (Beadle) on Apr 24, 2017 at 09:30 UTC | |
by dazz (Beadle) on Apr 24, 2017 at 09:38 UTC | |
by shmem (Chancellor) on Apr 24, 2017 at 09:46 UTC | |
by Eily (Monsignor) on Apr 24, 2017 at 09:43 UTC | |
by GrandFather (Saint) on Apr 24, 2017 at 09:46 UTC | |
by dazz (Beadle) on Apr 25, 2017 at 05:40 UTC | |
by haukex (Archbishop) on Apr 25, 2017 at 06:28 UTC | |
| |
by zentara (Cardinal) on Apr 25, 2017 at 13:51 UTC | |
|