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

Re: Getting path info in a mixed UNIX / NT environment

by myocom (Deacon)
on Dec 08, 2000 at 03:52 UTC ( [id://45648]=note: print w/replies, xml ) Need Help??


in reply to Getting path info in a mixed UNIX / NT environment

Your code as written won't work, for at least two reasons. One, unless you've defined one, there is no SOME_DRIVE environment variable. Two, you'll want to put double-quotes around that last bit:
my $path = "$DRIVE_LETTER/tmp/$some_file";

Depending on what your scripts do, though, you may not need to worry about what your current path is. And if you use relative paths, you shouldn't need to worry about drive letters whatsoever on Win2K.

Replies are listed 'Best First'.
(bbq) Re: Re: Getting path info in a mixed UNIX / NT environment
by BBQ (Curate) on Dec 08, 2000 at 12:57 UTC
    myocom is correct about the relative paths, but I'd go just a bit further and remind you that perl understands the root of the drive that it is being executed from. In other words, if you're installed in D:\Perl\bin\perl.exe, then / = D:\

    This is true for all Windows as far as I know...

    #!/home/bbq/bin/perl
    # Trust no1!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found