in reply to Include external variables into script
This hack is the first thing that comes to mind (untested):
It assumes that all variables are scalars, and that there are no stray $'s in the file. This would put the variables in the current package, but so what? The crucial question is: what are you planning to do with these variables?( my $code = do { local $/, @ARGV = './conf'; <> } ) =~ s/\$/'$'.__PACKAGE__.'::'/eg; eval $code;
the lowliest monk
|
|---|