Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Working directory oddity

by cLive ;-) (Parson)
on Oct 18, 2007 at 04:51 UTC ( #645644=note: print w/ replies, xml ) Need Help??


in reply to Working directory oddity

Windows, right? It helps if you clarify when writing these questions :)

Possibly abs_path can help?

use strict; use warnings; use Cwd qw(abs_path); chdir("C:\WINDOWS\PROGRAM FILES"); # <- or whatever it is in windows. my $thisdir = abs_path('.'); print "This dir is $this_dir\n";

Untested (I'm in Linux), but that would be my first stab at this.


Comment on Re: Working directory oddity
Download Code
Replies are listed 'Best First'.
Re^2: Working directory oddity
by ikegami (Pope) on Oct 18, 2007 at 05:38 UTC

    Sorry, that doesn't work :( and not just cause your slashes are unescaped ;)
    getcwd, cwd and abs_path all return paths using the same caps provided to chdir (and with the slashes reversed to /).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2015-07-30 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls