how do i retrieve values from a perl user defined function?

hi experts. for example, a function that i would manually create test(@array,$sum);
how would I in the script retireve to value of the sum variable? i know that @_ gives me everything but I would like to shove the $sum value in a variable in the function body. I hope i make sense. thanks.
LVL 2
micromarchAsked:
Who is Participating?
 
ozoCommented:
sub test{
   my $sum = pop;
   my @array = @_;
}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.