Somehow I missed that option. I suppose that for my purposes I should just write our a lot. I am working with a long list a variables and I would like to see the value next to the variable name.
I see that you are pushing for my but I am not convinced that is the best choice based on what I have been reading. It is easy enough to swap back and forth, so I suppose it doesn't matter much..... ( I went and made this to satisfy my curiosity at this point: )
# Begin use strict; our ( $var1 ) = ( 1 ); my ( $var2 ) = ( 2 ); our $ourcode = 'In ourcode eval:\n\$var1 = ${var1}\n\$var2 = ${var2}\n +'; my $mycode = 'In mycode eval:\n\$var1 = ${var1}\n\$var2 = ${var2}\n'; print eval('"' . $ourcode . '"'); print eval('"' . $mycode . '"'); print "In the main:\n\$var1 = ${var1}\n\$var2 = ${var2}\n"; # End
I thought that the eval might have tripped up with variables scoped to my, but everything worked out fine with the above test. I can't think of too many reasons that another script might call on variables within this script, so I may go with my after all.
In reply to Re^2: Is use strict always appropriate?
by Je55eah
in thread Please help me print this hash.
by Je55eah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |