CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [Wildcard] why doesn't the return function work here?: Edit Log



FishMonger
Veteran / Moderator

Oct 1, 2017, 2:22 PM


Views: 6484
Re: [Wildcard] why doesn't the return function work here?

$einsref and @einsref are 2 entirely separate vars.

$einsref is a reference to an array and needs to be de-referenced.


Code
my ($einsref, $zweiref) = tutnix();   

print "1: ", join (",",@{$einsref}), "\n"; # the braces are optional
print "2: ", join (",",@{$zweiref}), "\n";

sub tutnix
{
my @eins = (1..10);
my @zwei = (11..15);

return (\@eins, \@zwei);

}



(This post was edited by FishMonger on Oct 1, 2017, 2:24 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Oct 1, 2017, 2:24 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives