There's no need for eval evil or source filter trickery. The simplest method for this is to use perl's own include mechanism.
It's named do 'file;.
included.pl
our %b; @b{'a'..'z'} = 1 .. 26;
#! perl -slw use strict; use Data::Dumper; do 'included.pl'; ## Perl's include. our %b; print Dumper \%b;
In reply to Re: including another perl file
by BrowserUk
in thread including another perl file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |