Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
We don't bite newbies here... much
 
PerlMonks  

Re^2: how to get the parent directory name?

by grinder (Bishop)
on Dec 08, 2006 at 08:29 UTC ( [id://588581]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: how to get the parent directory name?
in thread how to get the parent directory name?

Bzzzt! Crash! This is the sound of the cross-platform compatibility police knocking at your door!

I feel obliged to point out that there is a module that encapsulates the concept of parent directory. Thus your code becomes:

use strict; use warnings; use Cwd; use File::Spec; print Cwd::realpath(File::Spec->updir);

When code begins to involve both Cwd and File::Spec, you know it's time to look at Path::Class (see elsewhere in this thread).

• another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://588581]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.