Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

correct way to use pp -a

by alw (Sexton)
on May 02, 2008 at 19:48 UTC ( #684244=perlquestion: print w/replies, xml ) Need Help??

alw has asked for the wisdom of the Perl Monks concerning the following question:

Ladies and Gentlemen, I have been trying to add a data file to windows executable created with pp. The program cannot find the file unless it is in the same folder as .exe file as a separate file. The original .pl file expects the data file to be in the same directory as the script. It is in the archive, and I've tried placing it in /, /script, /lib. Nothing works. I can copy both the .exe file and the data file somewhere else and it does work but I want to not have to copy the data file, since it's already in the archive. I thought that the -a flag is for this purpose. I must be missing something here. test script named test.pl
#!/usr/bin/perl # OS is windows XP perl 5.8.8 build 820 open FH,"hello.txt" or die "$!\n"; while ( <FH> ) { print; }
I have a text file in the same directory as the script named hello.txt. I then want to make an executable using pp: >pp -a hello.txt -o test.exe test.pl This creates an executable, but unless a copy of hello.txt is in the same folder, it will not find it. The -a flag did put the hello.txt file in the archive, but the script can't find it. Any ideas?

Replies are listed 'Best First'.
Re: correct way to use pp -a
by walto (Pilgrim) on May 03, 2008 at 15:50 UTC
    Not a solution, but a workaround is to place the content of hello.txt in the code of the script
    #!/usr/bin/perl # OS is windows XP perl 5.8.8 build 820 #open FH,"hello.txt" or die "$!\n"; while ( <DATA> ) { print; } __DATA__ one two three four

Re: correct way to use pp -a
by Cody Pendant (Prior) on May 03, 2008 at 21:39 UTC
    I bet this previous thread is the answer to your question.


    Nobody says perl looks like line-noise any more
    kids today don't know what line-noise IS ...
      You are right. I asked this question last year and forgot all about it. Sorry
Re: correct way to use pp -a
by perl-diddler (Chaplain) on May 02, 2008 at 23:14 UTC
    Sorry for my cluelessness, but what's "pp"? When I type it in on my systems, it says "command not found". Doesn't seem to be a valid windows command or program. -l

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://684244]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2021-03-05 23:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (115 votes). Check out past polls.

    Notices?