PerlAPP Problem to hidden $0, and arguments.

Posted by on 2015-08-31 10:48
Forums: PDK discussion | OS: Linux

In my source code .pl, I put the following code to change the value of $ 0 to change the arguments:
($ 0 = "$ 0argv") = ~ s / p \ s + \ w + \ s / x /;

This works for me to run normally With PERL, but when I package with PerlApp, just change the name of the process and maintains the grounds. I need to change everything with arguments.

Someone could help me?

ActiveState Staff
Thu, 2015-10-29 08:45

It has always been the case. The reason is summed up by a comment from Ikegami back in 2005.
"Since the Perl script and compiled Perl script were started with different commands, it's only normal for $0 to be different."

PerlApp provides Variables which can be used to help with needs like this:

As an example, see this thread on the mailing list from 2003: