in reply to subroutines and namespace
package whatever; ... @EXPORT = qw( $routine ); $routine = q^ $thing = something+something_else; lots and lots of code; ^; sub routine [ my ($thing, $other_thing) = @_; eval $routine; } package main; my $thing; my $other_thing; eval $routine;
If you want to run routine in local scope, eval $routine it. If you don't want it messing with your variables, call it with routine()
____________________
Jeremy
I didn't believe in evil until I dated it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: subroutines and namespace
by tilly (Archbishop) on Nov 03, 2001 at 11:37 UTC | |
by jepri (Parson) on Nov 03, 2001 at 11:46 UTC |