in reply to passing a variable from one subroutine to another

I'll agree with Zaxo on the fact that you shouldn't be using reserved words as variables/sub names. As far as using local to scope a global, most people recommend against using it since it can confuse the flow of a program. Though using it is fully valid if you want to make your $error a global. I would suggest the following solution:
sub execute { my $error = $s->$error if ($count > 0); ## log this action &log_action($error) if ($count > 0); # just pass the $error var to &log_action } sub log_action { my $i = shift; if ($i) { print "\n$i\n\n"; print FH "$format $error"; } }
Hope that does the trick for you.

BlackJudas