7stud has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
Here is the code I have a question about:
sub do_stuff { my($x) = ($_[0] || 0); ... }
Do the parentheses around $x do anything? It seems to me that the rhs will always be a scalar, and these are equivalent:
my $x = 10; print $x, "\n"; my ($y) = 10; print $y, "\n"; --output:-- 10 10
Back to
Seekers of Perl Wisdom