Initializing hashes or arrays that way doesn’t buy anything. The scalar initialization to an empty string can actually matter if you want to avoid a certain kind of warning–
moo@cow[91]~>perl -we 'my $s; $s =~ /./' Use of uninitialized value $s in pattern match (m//) at -e line 1. moo@cow[92]~>perl -we 'my $s = ""; $s =~ /./' moo@cow[93]~>
I prefer no warnings "uninitialized"; for this general case but sometimes you really do want to know if the scalar has an assignment, even the empty string, or not.
In reply to Re: need a clearer understanding
by Your Mother
in thread need a clearer understanding
by DanielM0412
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |