Question

I'm having some trouble using the pp command to create standalone executables on a Linux machine. It seems that every tutorial says a different thing and I'm a bit confused. I'd like your help regarding two issues:
1. I'm trying to include a module created by me (.pm file), but not sure how to do so and keep getting error messages. Should I use the -M option? or should it be -B? And once the module is included, how do I call it from the script? the usual way (i.e. "use module" and then "module::sub")?
2. I want to include some text files too. So far, I've tried -a and -l options, but not sure if they actually work. Which one should I use? Also, how do I open these files? For instance, if I pack the file tmp.txt, what should the open command look like?
Thank you very much!

Was it helpful?

Solution

  1. Adding modules with the -M option and use the module as usual.
  2. Adding your text file with the -a option, from pp's manual:

By default, files are placed under / inside the package with their original names.

so you should be able to read these text files with:

my $content = PAR::read_file('your_file.txt');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top