in reply to Persistant Perl arguments ( pperl )

From the docs for PPerl:
$ pperl <perl params> -- <pperl params> scriptname <script params>

I think you need this:

#!/usr/bin/perl -- --prefork 25 print "\n\nHELLO\n";

You need to tell pperl that your perl options are through and your pperl options have started. The '--' by itself should do that.

Update:

I got PPerl to install (had to play some ndbm/gdbm games with the makefile, though), and tested this theory. You do need the separator between the perl options and the pperl options, even if you have no perl options to name. The pperl arguments seem to work with either the equal sign or a space.

Update 2: You're right, and I did run it accidentally as perl instead of pperl on the sheband line. When I try, I get the same thing you do. Yet /usr/local/bin/pperl --prefork=25 foo works from the command line, with a Perl program in file "foo". Perhaps PPerl just doesn't support working from the shebang line, and must be invoked on a program that's in a file.

Replies are listed 'Best First'.
Re^2: Persistant Perl arguments ( pperl )
by Anonymous Monk on Apr 28, 2008 at 17:59 UTC
    Thanks for the reply mischief, however your example uses "/usr/bin/perl" not "/usr/bin/pperl". Maybe I don't understand, but heres the scenario. This script will be called as a cgi file, so I can not run via the command line, but I still need to get that --prefork=25 option whenever apache hits the file. Your example uses /usr/bin/perl and just ignores the option. If I use your method with /usr/bin/pperl I get the following.
    #!/usr/bin/pperl -- --prefork=25 print "\n\nHELLO\n";
    Output:
    Can't open perl script "--prefork=25": No such file or directory pperl: perl script failed to start: No such file or directory
    Let me know if I'm not making any sense!
      On further examination, it looks like you can't use pperl properly from the shebang line. It appears to be intended to launch a separate program to be named on the command line only. See my update at Re: Persistant Perl arguments ( pperl ) for more info.