Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: cwd pragma (rfc)

by japhy (Canon)
on Jun 27, 2006 at 22:34 UTC ( [id://557886]=note: print w/replies, xml ) Need Help??


in reply to cwd pragma (rfc)

I would suggest changing $realpath =~ s/$basename$//; to $realpath =~ s/\Q$basename\E$//;

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: cwd pragma (rfc)
by ikegami (Patriarch) on Jun 27, 2006 at 23:14 UTC
    or
    substr($realpath, -length($basename)) = '' if substr($realpath, -length($basename)) eq $basename;
      Maybe just
      $realpath = join(q//, split(/.[^\/]+$/,$realpath));


        The point of mine was to remove slow operations, not add new ones.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-28 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found