Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Difference between my ($foo) & my $foo

by repellent (Priest)
on Feb 12, 2009 at 19:54 UTC ( [id://743441]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my (undef, $a, undef, $b, @rest, $c) = (1, 2, 3, 4, 5, 6, 7, 8);
    
  2. or download this
    my $count   = @rest; # 4 - because there are four items (scalar contex
    +t)
    
    my ($first) = @rest; # 5 - because first item is 5 (list context)
    
  3. or download this
    my $last = (11, 22, 33, 999); # 999 - because assigning LIST to scalar
    + only picks last item
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://743441]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-03-28 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found