pp --addfile query

P

P.R.Brady

The documentation for pp suggests you can add a file in as well as the
script with --addfile=filename
Can the script read this file? How would it open it?
This would be super for bundling both an application and the steering
file which defines how it operates.

Regards
Phil
 
A

Alan Stewart

The documentation for pp suggests you can add a file in as well as the
script with --addfile=filename
Can the script read this file? How would it open it?
This would be super for bundling both an application and the steering
file which defines how it operates.

Regards
Phil

To pack "somedir/steering.dat" into the "config/" zip dir inside the
executable:

pp -a somedir/steering.dat;config/steering.dat -o prog.exe prog.pl

Inside prog.pl, read it with:

my $contents = PAR::read_file("config/steering.dat");

The -a syntax above is "-a <original_filename>;<filename_in_zip>"
The function PAR::read_file is in PAR.pm which is already loaded, no
"use PAR.pm;" needed.

Alan Stewart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,422
Latest member
LatashiaZc

Latest Threads

Top