develooper Front page | perl.perl6.users | Postings from July 2021

Re: use lib and locations in a variable

Thread Previous | Thread Next
From:
Bruce Gray
Date:
July 11, 2021 22:27
Subject:
Re: use lib and locations in a variable
Message ID:
02A23F7C-7F2C-4226-BEAC-9E37E52EF7BE@acm.org


> On Jul 11, 2021, at 1:13 AM, ToddAndMargo via perl6-users <perl6-users@perl.org> wrote:

—snip--

> $*PROGRAM.parent is just a silly dot.

—snip—

Todd,

That is true only when the program you are running happens to be in your current directory
(as is very common, but not nearly universal, and not the case for Joe’s use case).

cat > a.raku <<END
    say \$*PROGRAM.parent;
END
raku a.raku
OUTPUT: ".".IO

mkdir        Temp_some_subdir
mv -i a.raku Temp_some_subdir/
raku         Temp_some_subdir/a.raku
OUTPUT: "Temp_some_subdir”.IO

— 
Hope this helps,
Bruce Gray (Util of PerlMonks)




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About