Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME.

Am 30.05.2015 um 15:00 schrieb Tom Browder:
> I finally found the Perl 6 version of Perl 5's $0 listed in:
>
>   tablets.perl6.org/appendix-b-grouped.html#special-variables
>
> as '$*EXECUTABLE_NAME', and I expected it to act the same as $0 in
> Perl 6, but I have two problems with it:
>
> 1.  When used it yields 'perl6' regardless of the script's name (a bug?).
>
> $ cat t.pl
> #!/usr/bin/env perl6
> say $*EXECUTABLE_NAME;
> $ chmod +x t.pl
> $ ./t.pl
> perl6
>
> 2.  It seems very ungainly to go from two characters to 17.  Couldn't
> it be shortened a bit, say,
>
>   '$*0' or '$*EXE_NAME' or '$*PROG' or something else?
>
> Am I doing something wrong or do I have the wrong expectations?
>
> $  perl6 --version
> This is perl6 version 2015.03-48-g9746e88 built on MoarVM version 2015.03
>
> Best regards,
>
> -Tom

Reply via email to