Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2016-12-11 01:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.