Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: how to get the parent directory name?

by reneeb (Chaplain)
on Dec 08, 2006 at 11:50 UTC ( #588568=note: print w/replies, xml ) Need Help??


in reply to how to get the parent directory name?

#!/usr/bin/perl use strict; use warnings; use Cwd; print Cwd::realpath('..');

Replies are listed 'Best First'.
Re^2: how to get the parent directory name?
by grinder (Bishop) on Dec 08, 2006 at 13:29 UTC

    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
Node Status?
node history
Node Type: note [id://588568]
help
Chatterbox?
[marto]: Corion you under estimate how lazy these admins are :P
[Discipulus]: we too; using opsview alarms
[marto]: the key word: outsourcing ;)
[Corion]: marto: Yeah, feels like that ;) You could set up the cronjob that auto-creates tickets :-))
[marto]: the ticketing system does not accept calls via email, nor has it a working API. It's tied into Active Directory for authentication and the Solaris boxes aren't on that domain
[Corion]: The one thing I haven't figured out a solution to is how to get an edge-trigger instead of sending an email every 5 minutes if the usage is above 90%. I want one mail when it goes over 90% but no more emails as long as it stays between 90% and 95%.
[Corion]: marto: Clever! ;)
[Corion]: You can only reach me by pager
[Corion]: Maybe the solution would be to launch a cron job every minute that takes two measurements a minute apart and sends a mail if the usage is below on the first and above threshold on the last measurement
[marto]: that's essentially it :)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-01-24 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (203 votes). Check out past polls.