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

Re: question about || operator and list context

by converter (Priest)
on Jun 22, 2003 at 03:32 UTC ( [id://267908]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub context {
        print
    ...
    void
    scalar
    a=[b],b=[]
    
  2. or download this
    from the perl 5.8 perlfunc scalar() section:
    
    ...
    evaluating all but the last element in void context
    and returning the final element evaluated in scalar
    context. This is seldom what you want.
    
  3. or download this
    $c = scalar(context('a'), context('b'));
    print "$c\n";
    void
    scalar
    b
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found