Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find path to the executing Raku script

Tags:

raku

Could someone tell me how I can find, within the executing Raku script itself, the path to the script?

I am looking for the equivalent of this Perl code in Raku:

$path=abs_path($0);
like image 294
Tao Wang Avatar asked Oct 28 '20 19:10

Tao Wang


1 Answers

Use $*PROGRAM

see: https://docs.raku.org/language/variables#index-entry-$*PROGRAM

$*PROGRAM

Contains the location (in the form of an IO::Path object) of the Raku program being executed.

like image 99
ugexe Avatar answered Nov 10 '22 04:11

ugexe