I have this code to print the current directory using Perl:
use Cwd qw(abs_path); my $path = abs_path($0); print \"$path\\n\";
But it is di
You could use FindBin:
FindBin
use FindBin '$RealBin'; print "$RealBin\n";
FindBin is a standard module that is installed when you install Perl. To get a list of the standard pragmatics and modules, see perldoc perlmodlib.
perldoc perlmodlib