Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 about the Monastery: (14)
As of 2015-07-02 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls