Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^6: Getting the absolute path of a script, without PWD (bug?)(update)

by choroba (Cardinal)
on Jul 16, 2021 at 08:52 UTC ( [id://11135062] : note . print w/replies, xml ) Need Help??


in reply to Re^5: Getting the absolute path of a script, without PWD (bug?)(update)
in thread Getting the shell's version of working directory, without PWD's help

> it seems that `pwd` inside Perl doesn't default like pwd in bash

Note that qx// doesn't call bash but sh, which might be a different shell (/bin/dash on Ubuntu, for example).

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^7: Getting the absolute path of a script, without PWD (bug?)(update)
by perlancar (Hermit) on Jul 16, 2021 at 10:20 UTC
    Noted, but that's not the cause of the difference here. `pwd` under dash still calls the shell builtin, which defaults to pwd -L.