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

Please don't use string functions on paths; doing it like this is liable
to break when used on another OS like windows where paths are separated
with \ instead of /

What you're doing here is exactly what .IO.basename and .IO.dirname are for.

    https://docs.perl6.org/type/IO::Path#method_basename
    https://docs.perl6.org/type/IO::Path#method_dirname

Reply via email to