Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Parent directory - regex

by gawatkins (Monsignor)
on Jun 17, 2004 at 12:05 UTC ( #367588=note: print w/replies, xml ) Need Help??

in reply to Parent directory - regex

Here is an example of a simple script to do this without using regex:

#!\usr\bin\perl use strict; my $myDirectory = "/dir1/dir2/dir3/dir4/dirLast//"; my @myDir = split('/', $myDirectory); #creates an array of Dir names pop @myDir; #removes the currnet directory $myDirectory = join( '/', @myDir); #Joins names back into parent path print $myDirectory;

Greg W

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://367588]
[LanX]: missing for month
[LanX]: D : Oberbefehlshaber
[GotToBTru]: yeah, thats the story I remember. some card the President is supposed to carry around at all times
[GotToBTru]: I suppose the actual details about what is necessary to actually do something is kept fuzzy deliberately
[LanX]: the interview was with the guy who designed the process
[LanX]: in the 70s
[GotToBTru]: so the font on the card is probably NOT Comic Sans
[GotToBTru]: that's a relief

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-01-20 12:52 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.