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.
Who is Participating?
ozoConnect With a Mentor Commented:
sub test{
   my $sum = pop;
   my @array = @_;
All Courses

From novice to tech pro — start learning today.