Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Why parens?

by choroba (Chancellor)
on Feb 07, 2013 at 17:21 UTC ( #1017703=note: print w/replies, xml ) Need Help??


in reply to Why parens?

If the declaration is not followed by an assignment, it is purely (un)aesthetic. If there is an assignment, the difference is important - the parentheses introduce list context on the rvalue. For example:
$_='....x....x....x...'; my $scalar = /x/g; my ($list) = /x/g; print $scalar, "\t", $list, ".\n";
Output:
1 x.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017703]
help
Chatterbox?
[hippo]: Thanks for that. I had rather supposed that Nvidia had moved on over the last 15 years but apparently not so much.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-05-26 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?