in reply to passing a variable from one subroutine to another
sub exec{ #... &log_action('error',$error); } sub log_action{ my $i = shift; #get first parameter my $error = shift; get second parameter # note that this $error here is not the same variable but has the same + value! #do whatever with it... }
You should also consult your Camel Book on Subroutines.
Hope this helps,
C-Keen
|
|---|