I'm having some difficulty with capturing the info contained in $0 when using ActiveState Perl under Windows.

The environment:

Perl Version: v5.8.4 built for MSWin32-x86-multi-thread
Binary build 810
Built Jun 1 2004 11:52:21

PerlApp Version: 6.0.1 build 138990

OS: Microsoft Windows XP Version 5.1.2600

The script I'm using to reproduce the problem:

use Cwd; use FindBin qw($RealBin); $this_proc = $0; # Get name of this p +rogram $this_proc =~ s#.*\\##; # Just the name.ext $this_proc_path = $0; # Dir. path $this_proc_path =~ s#$this_proc##; $this_proc = $0; # Get name of this p +rogram $this_proc =~ s#.*\\##; $this_proc =~ s/\.pl//ig if ($this_proc =~ /\.pl/); $this_proc =~ s/\.exe//ig if ($this_proc =~ /\.exe/); printf("\$this_proc: $this_proc\n"); printf("\$this_proc_path: $this_proc_path\n"); printf("\$RealBin: $RealBin\n");
Now, when I run the script (p.pl), I get the expected output, viz:

$this_proc: P.PL $this_proc_path: C:\tmp\ $RealBin: C:/tmp
However, when I use PerlApp from the Perl Development Kit, I get the following output:
$this_proc: p $this_proc_path: $RealBin: C:/tmp
The command line I use to invoke PerlApp is:

perlapp --norunlib --clean --force --exe p.exe --perl C:\Perl\bin\perl +.exe p.pl

Is there a reason as to why the output is different... or should this be considered a bug? I remember reading there was a problem with build 804 (I think) but I don't know if it's supposed to be resolved.

Thanks.

John


In reply to Problems with Contents of $0 when using ActiveState PerlApp by ozboomer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.