Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Is any simple way to get the current direcoty name?

by joealba (Hermit)
on Jul 15, 2002 at 17:41 UTC ( [id://181864]=note: print w/replies, xml ) Need Help??


in reply to Is any simple way to get the current directory name?

Note: Bad answer about using $ENV{PWD} removed (instead of using my whiteout).

Use Cwd.

Replies are listed 'Best First'.
Re: Re: Is any simple way to get the current directory name?
by jsegal (Friar) on Jul 15, 2002 at 17:53 UTC
    The problem with $ENV{PWD} is that it doesn't stay "linked." i.e.
    print $ENV{PWD},"\n"; chdir("..") print $ENV{PWD},"\n";
    will print the same thing twice, which is probably not what you want. (If you use Cwd and ask it to override chdir, it will automatically keep $ENV{PWD} in sync with the actual current working directory, but by default it is not kept in sync).

    --JAS

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-23 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found