Is there any way to do this without writing our for each variable or without listing all of the variable names within an our declaration and again when I assign values to them?
Sure
my( $foo, $bar ) = ( 1, 2 );
should I do the following instead?
No, that misses the point , might as well not use strict at all in that case. strict itself confers no benefits; The benefits come from avoidance of the bad practices forbidden by strict :)
To understand these read: See Tutorials: Variable Scoping in Perl: the basics, Coping with Scoping , Mini-Tutorial: Perl's Memory Management, Lexical scoping like a fox, Read this if you want to cut your development time in half!
The free Modern Perl book covers all this too
In reply to Re: Is use strict always appropriate?
by Anonymous Monk
in thread Please help me print this hash.
by Je55eah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |