Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by perlancar (Hermit)
on Jul 16, 2021 at 10:30 UTC ( #11135064=note: print w/replies, xml ) Need Help??


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

Maybe after I'm more knowledgeable about the actual differences between getcwd() and cwd(). Right now, it's not clear that cwd() should be "fixed". getcwd() tries to call getcwd(3) or reimplements it, while cwd() makes no such promise. And this statement is not strictly wrong: "For most systems it is identical to `pwd` (but without the trailing line terminator)." Though it might benefit the reader to be aware of the difference between pwd -P and pwd -L, and which one the reader is getting with `pwd`.
  • Comment on Re^8: Getting the absolute path of a script, without PWD (bug)

Replies are listed 'Best First'.
Re^9: Getting the absolute path of a script, without PWD (bug)
by LanX (Saint) on Jul 16, 2021 at 10:43 UTC
    Perl should ideally have predictable and consistent behavior across all plattforms and not depend on some shell settings.

    Alone the fact that termux acts differently to ubuntu should ring the alarm bell ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135064]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-12-10 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?