On 30 May 2015 3:00:25 pm GMT+02:00, Tom Browder <tom.brow...@gmail.com> wrote: >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
Hi Tom, I believe what you are looking for is called $*PROGRAM_NAME. See also http://doc.perl6.org/language/variables#Special_Variables Cheers, Paul