in reply to How not to write subroutines
All you are doing by putting this code in a BEGIN block is making sure it runs before anything else, but I do not see anything in it that necessarily has to be in a BEGIN block. You can have it at the top of the code and it would run the same.
Your debug sub will print the same original values for $a, $b and $c. If you want to print current values, you should be passing the values to the debug sub (and change it to accept the passed values, it is best not to use globals either).
Did this accomplish what you wanted in your script?
-imran
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How not to write subroutines
by gustavderdrache (Acolyte) on Jan 15, 2006 at 15:24 UTC |