Gossamer Forum
Home : General : Perl Programming :

return two arrays from a sub

Quote Reply
return two arrays from a sub
is this legal?
Code:
...
my (@par,@whandicap) = &get_par_for_course;
...

sub get_par_for_course {
# --------------------------------------------------------
# lookup course and get par for each hole


&switch_to_courses;

my (%course) = &get_record2('1'); # always berkeley hills = #1


my (@par) = split (/:/, $course{'WPar'});
my (@whandicap) = split (/:/, $course{'WHandicap'});

return(@par,@whandicap);


}



or do i need separate routines to retrieve the two elements?
Subject Author Views Date
Thread return two arrays from a sub delicia 2001 Jun 30, 2021, 12:38 PM
Post Re: [delicia] return two arrays from a sub
delicia 1970 Jun 30, 2021, 12:49 PM
Post Re: [delicia] return two arrays from a sub
Andy 1948 Jul 6, 2021, 1:00 AM