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
|
---|