On 09/25/2017 12:22 AM, ToddAndMargo wrote:
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 :

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

    $ /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:
Hello,

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:

<code>
#!/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>";
</code>

$ 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/>

Second itteration:

<code>
#!/usr/bin/env perl6

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

my $IAm;
my $IAmFrom;

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

Reply via email to