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
|
---|
In Section
Seekers of Perl Wisdom