Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Why does foo() evaluate in array context in "${\foo()}"?

by ikegami (Patriarch)
on Apr 23, 2009 at 06:25 UTC ( [id://759476]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -e"print qq{$_: $$_\n} for \( 'a', 'b', 'c' );"
    SCALAR(0x239b9c): a
    ...
    
    >perl -e"@a = qw( a b c ); print qq{$_: @$_\n} for \@a;"
    ARRAY(0x1829a04): a b c
    
  2. or download this
    >perl -e"print qq{$_: $$_\n} for \sub { qw( a b c ) }->();"
    SCALAR(0x239c5c): a
    SCALAR(0x239cac): b
    SCALAR(0x239cbc): c
    
  3. or download this
    >perl -le"@a = 'a' x 5; print 0+@a"
    1
    ...
    
    >perl -le"@a = sub { qw( a ) }->() x 5; print 0+@a"
    1
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found