Help for this page

Select Code to Download


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