Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Re: Re: Re: What should be returned in scalar context? (best practice)

by jarich (Curate)
on Dec 22, 2003 at 04:51 UTC ( [id://316305]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub f1 { return (33, 42) }
    sub f2 { return my @x = (33, 42) }
    ...
    print "first: $first    (expecting 33)\n";
    print "last: $last      (expecing 42)\n";
    print "first2: $first2  (expecting 33)\n";
    
  2. or download this
    # Output:
    nelts: 42    (expecting 2)
    first: 33    (expecting 33)
    last: 2      (expecing 42)
    first2: 33  (expecting 33)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found