- or download this
my $filename = '/var/lib/some_dir/sume_subdir/filename';
- or download this
my $nspace = $filename;
$nspace =~ s/[^a-zA-Z]/_/g;
- or download this
$nspace= "ROOT::NameSpace::$nspace";
- or download this
open FILE, $filename or die $!;
my @content = <FILE>;
close FILE;
- or download this
my $eval = qq~package $nspace;
sub handler {
local $0 = $filename;~ . join('', @content);
- or download this
eval $eval;
die $@ if $@; # will die if there are any compile time errors.
- or download this
my $codevector_name = join '::', $nspace, 'handler';
my $codevector = &\{ $codevector_name };
eval { $codevector->(@_) }; # pass arguments to the handler
die $@ if $@