Wed Aug 19 07:37:25 2009: Request 48770 was acted upon. Transaction: Correspondence added by nj88ud...@sneakemail.com Queue: PAR Subject: Re: [rt.cpan.org #48770] $0 is not working when PAR is used Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: mianro...@hotmail.com Status: open Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48770 >
Hi Miguel, Miguel Angel Rojas Gómez via RT wrote: > Queue: PAR > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48770 > >> In general, it is NOT reasonable to expect that a packed program >> will behave absoolutely identical to the original script. PAR tries >> hard and jumps thru several hoops to make some stupid constructs >> magically work out of the box. But there are known cases, where >> it doesn't work and you have to change your expectations and >> your code. > > > > Ok, that would mean that PAR a perl file is not really useful if, as > you mentioned, because perl code behaviour would change. Unless you > really know which functions/contructions are not affected. You're being a bit silly here. PAR's quite useful and employed for deployment of large applications to many tens of thousands of computers worldwide. > Is there a list in which we can take a look at? I think this is something > should be stated in the man pages and CPAN PAR web. There's actually rather few issues. They generally crop up when your code adds assumptions about being able to access the files that a package was loaded from via the file system. OTOH, these things are rarely necessary and usually constitute a code stink anyway. >> Patches welcome, the stuff is in myldr/*.c in the PAR::Packer source. >> You might want to consult the Perl source (mg.c and perl.c in >> particular) to study the contortions Perl has to go thru to >> implement the current behaviour. > > > Thanks! I took a look into it and the behaviour seems as you mentioned. > But anyway, I think argv and envp behaviour should not be changed in a PAR > executable (quite critical if you want to access these option in your code). > > Of course, it seems this is not something trivial but it is something is > impacting > perl coding, and if this is not fixed, it should be reflected somewhere. Documentation patches welcome. Cheers, Steffen