Do you know where your variables are? | |
PerlMonks |
Re: why qw() rather than ()by mwp (Hermit) |
on Jan 22, 2001 at 18:32 UTC ( [id://53492]=note: print w/replies, xml ) | Need Help?? |
use vars qw(@array %hash $scalar);
Is actually equivalent to:
use vars ('@array', '%hash', '$scalar');
qw() is great for defining lists, especially of single-word strings, because you don't have to quote and comma delimit the list. It's usefulness becomes even more apparent when you have rather complicated code and if you can reduce punctuation you'll save on aspirin bills.
In Section
Seekers of Perl Wisdom
|
|