Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: cwd pragma (rfc)

by japhy (Canon)
on Jun 27, 2006 at 22:34 UTC ( #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? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2022-05-28 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (98 votes). Check out past polls.

    Notices?