Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Answer: How do I change .. to the real filename?

by Shakya (Initiate)
on Oct 06, 2007 at 18:59 UTC ( #643140=categorized answer: print w/replies, xml ) Need Help??

Q&A > regular expressions > How do I change .. to the real filename? - Answer contributed by Shakya

You can even try this -
1 while ($string =~ s!(/(?:[^/.]+/)*)((?:[^/.]+/)+\.\./?)(.*)$!$1$3!g) +;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-11-23 04:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (328 votes). Check out past polls.

    Notices?