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

Re: Using return values in subroutines

by sk (Curate)
on Mar 27, 2006 at 00:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://539332]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found