my $num = 1;
cal($num);
print "$newnum\n";
sub cal{
my $num = shift;
my $newnum = $num + 1;
return $newnum;
}
is it possible to take variable $newnum and use its value outside of the sub cal. At the moment if i try and print the variable $newnum outside of the subroutine nothing is returned.