in reply to pp -a is not working

You didn't follow tutorial http://search.cpan.org/dist/PAR/lib/PAR/Tutorial.pod#Accessing_packed_files
Accessing packed files * To get the host archive from a packed program: my $zip = PAR::par_handle($0); # an Archive::Zip object my $content = $zip->contents('MANIFEST'); * Same thing, but with read_file(): my $content = PAR::read_file('MANIFEST'); * Loaded PAR files are stored in %PAR::LibCache: use PAR '/home/mylibs/*.par'; while (my ($filename, $zip) = each %PAR::LibCache) { print "[$filename - MANIFEST]\n"; print $zip->contents('MANIFEST'); }

Replies are listed 'Best First'.
Re^2: pp -a is not working
by alw (Sexton) on Aug 22, 2007 at 19:35 UTC
    Your wrong I did read that tutorial and your right I completely ignored it. With these changes I can run the standalone .pl file or the .exe file in any location. Thanks
    #!/usr/bin/perl use strict; use Archive::Zip; use Archive::Zip::MemberRead; if ( open FH,"data.txt" ) { print "using normal data.txt file\n"; while ( <FH> ) { print $_; } } else { my $zip = PAR::par_handle($0); my $fh = new Archive::Zip::MemberRead($zip, "data.txt"); print "using packed data.txt file\n"; while ( defined( my $line = $fh->getline()) ) { print "$line\n"; } print "\nOr another way\n"; my $content = PAR::read_file('data.txt'); print $content; }