|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Declaring my $var versus declaring my($var)by jwkrahn (Abbot) |
| on Jun 10, 2011 at 14:13 UTC ( [id://909129]=note: print w/replies, xml ) | Need Help?? |
|
In your example my($a) = 1; the parentheses impose list context on the assignment, which in this case is OK because you are only assigning a list of one element, but it will make a difference on functions that distinguish between scalar and list context (i.e. localtime). In your example our(%list) = (); the parentheses around %list are redundant because %list by itseft already enforces list context.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||