and then explicitly pass in your directory.sub list_dir { my $directory = shift; # Proceed as before }
Oh, and tell the author of that script for me that implicitly passing data into a subroutine through something you are using as a global variable is a really bad design. Which is why I am intentionally not telling you how to do it while preserving the current (very bad) API.
In reply to Re (tilly) 1: subroutines
by tilly
in thread subroutines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |