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

Re: Using return values in subroutines

by sk (Curate)
on Mar 27, 2006 at 00:37 UTC ( #539332=note: print w/replies, xml ) Need Help??


in reply to Using return values in subroutines

#/usr/local/bin/perl use strict; use warnings; main(); sub main { second(first()); } sub first { my @ret = qw (from first sub); return (@ret); } sub second { print "Message from first sub: " , join (' ', @_), $/; }

output

Message from first sub: from first sub

Btw, you don't need the & to call the sub.

cheers

SK

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539332]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2017-06-26 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (578 votes). Check out past polls.