Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: dir match, dir may or may not appear

by GrandFather (Saint)
on Jan 12, 2016 at 10:04 UTC ( #1152543=note: print w/replies, xml ) Need Help??


in reply to dir match, dir may or may not appear

/usr/local/bin is a special case of /usr/*anydir*/bin so the various answers you were given in the CB would do the job. Here's one:

$path =~ m~^/usr (?: (?:/[^/\0]+|\\/)+ )? /bin~x;

that uses elements of my and tye's CB answers.

Premature optimization is the root of all job security

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-08-10 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?