Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Apr 23, 2009 at 09:54 UTC ( [id://759495]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    C:\test>perl -MO=Deparse -e"print scalar( 'fred', 'john', 'bill' )"
    print scalar('???', '???', 'bill');
    -e syntax OK
    
  2. or download this
    C:\test>perl -we"print scalar( 'fred', 'john', 'bill' )"
    Useless use of a constant in void context at -e line 1.
    Useless use of a constant in void context at -e line 1.
    bill
    
  3. or download this
    C:\test>perl -MO=Deparse -e"print scalar( sub{'fred', 'john', 'bill'}-
    +>() )"
    print scalar sub {
    ...
    }
    ->();
    -e syntax OK
    
  4. or download this
    C:\test>perl -we"print scalar( sub{'fred', 'john', 'bill'}->() )"
    bill
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found