my $foo= (my $bar = localtime)?("$bar hello"):("FAILED!"); #### Global symbol "$bar" requires explicit package name at ./scope.pl line (whatever) #### print do { if(my $bar = localtime){ "$bar hello"}else{ "FAILED!" } };
## Global symbol "$bar" requires explicit package name at ./scope.pl line (whatever) ##
## print do { if(my $bar = localtime){ "$bar hello"}else{ "FAILED!" } };