package Bam::Kapow;
use strict;
use Carp;
use File::Basename;
use File::Spec::Functions;
our $VERSION = "0.01";
our %Info = ();
# load the data file
for my $data (qw( motd issue ) ) {
my $file = catfile( dirname( $INC{'Bam/Kapow.pm'} ), 'Kapow', $data );
open my $fh, $file
or carp "Can't open $file: $!";
$Info{$data} = join '', <$fh>;
close $fh;
}
1;
####
Message of the day: PAR rules!
##
##
Well, I have this minor issue with PAR...
##
##
#!/usr/bin/perl
use Bam::Kapow;
print "Using Bam::Kapow version $Bam::Kapow::VERSION\n";
print "MOTD: $Bam::Kapow::Info{motd}\n";
print "Got Bam::Kapow from $INC{'Bam/Kapow.pm'}\n";
##
##
$ find lib/Bam/Kapow/ -type f > bam_kapow.lst
$ pp -o script.exe -A bam_kapow.lst -I lib script.pl
$ PATH= ./script.exe
Using Bam::Kapow version 0.01
MOTD: Message of the day: PAR rules!
Got Bam::Kapow from /tmp/par-ufwk/cache-e73b24e48419250052360127de57a074/inc/lib/Bam/Kapow.pm
##
##
#!/usr/bin/perl
use PAR;
use lib 'Bam-Kapow';
use Bam::Kapow;
print "Using Bam::Kapow version $Bam::Kapow::VERSION\n";
print "MOTD: $Bam::Kapow::Info{motd}\n";
print "Got Bam::Kapow from $INC{'Bam/Kapow.pm'}\n";
##
##
$ zip -r Bam-Kapow.par lib
adding: lib/ (stored 0%)
adding: lib/Bam/ (stored 0%)
adding: lib/Bam/Kapow/ (stored 0%)
adding: lib/Bam/Kapow/motd (stored 0%)
adding: lib/Bam/Kapow/issue (stored 0%)
adding: lib/Bam/Kapow.pm (deflated 40%)
$ perl script2.pl
perl script2.pl
Can't open /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/Kapow/motd: No such file or directory at script2.pl line 4
Can't open /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/Kapow/issue: No such file or directory at script2.pl line 4
Using Bam::Kapow version 0.01
MOTD:
Got Bam::Kapow from /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/a23f3e6c.pm
ls /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/
a23f3e6c.pm
##
##
$ pp -o Bam-Kapow.par -p -M Bam::Kapow -A bam_kapow.lst -I lib -e 1
$ perl script2.pl
Can't open /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/Kapow/motd: No such file or directory at script2.pl line 4
Can't open /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/Kapow/issue: No such file or directory at script2.pl line 4
Using Bam::Kapow version 0.01
MOTD:
Got Bam::Kapow from /tmp/par-ufwk/cache-51eaa99df530ab0d3b760931a92bb43c/40599894.pm