On Tue, Jun 17, 2014 at 3:27 PM, Jim Gibson <jimsgib...@gmail.com> wrote:

>   my $upload = $main::global->{'form'}->{'image_upload'} || '';
>   if ($main::global->{'admin'} && $upload ne '' ) {
>     $data->{'image'} = CopyTempFile('image');
>   }
>
>
> I find that much more readable and will not generate any undefined
> warnings.
>

Well, it might if {form} is a missing level:
$ cat /tmp/h.pl
#!perl
use strict;
use warnings;
my $global ;
$global->{ form} = {image_upload => "image"} ;
my $upload = $global->{form}->{image_upload} ;
print "form: $upload\n";
$upload = $global->{fom}->{image_upload} ;
print "fom: $upload\n";

$ perl /tmp/h.pl
form: image
Use of uninitialized value in concatenation (.) or string at /tmp/h.pl line
9.
fom:



-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk

Reply via email to