Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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


Comment on Re: Using return values in subroutines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-10-22 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls