On 09/25/2017 12:14 AM, ToddAndMargo wrote:
Le 25 septembre 2017 08:55:59 GMT+02:00, ToddAndMargo <toddandma...@zoho.com> a écrit :

    1: #!/usr/bin/env perl6
    3: say "Full file name <$?FILE;>
    5: my $IAmFrom;
    6:   $IAmFrom = $?FILE;
    7:   $IAmFrom ~~ \.*/||;
    8: say "IAmFrom <$IAmFrom>";

    $ /home/linuxutil/FileTest.pl6
    ===SORRY!=== Error while compiling /home/linuxutil/FileTest.pl6
    Variable '$IAmFrom' is not declared
    at /home/linuxutil/FileTest.pl6:5
    ------> my ⏏$IAmFrom = $?FILE;

    Sure look declaired to me.  What did I typo?

On 09/25/2017 12:09 AM, Julien Simonet wrote:

I think your problem is coming from a (") missing at line 3.
At the same line, the semicolon (;) is misplaced : it should be at the end if line.

I hope I helped :)

That was it.  Thank you!

In case anyone is curious, this it the final test with all the
booboo's removed:

#!/usr/bin/env perl6

say "Full file name <$?FILE>";

my $IAm;
my $IAmFrom;
   $IAmFrom = $?FILE;
   $IAmFrom ~~ m|(.*\/)(.*)|;
   $IAmFrom = $0;
   $IAm     = $1;
say "IAm            <$IAm>\nIAmFrom        <$IAmFrom>";

$ FileTest.pl6
Full file name </home/linuxutil/./FileTest.pl6>
IAm            <FileTest.pl6>
IAmFrom        </home/linuxutil/./>

$ /home/linuxutil/FileTest.pl6
Full file name </home/linuxutil/FileTest.pl6>
IAm            <FileTest.pl6>
IAmFrom        </home/linuxutil/>

Reply via email to