print join ":", grep { m{^/users/ctbld/} } split /:/, $ENV{INCLUDE};
However, you'll have a hard time manipulating environment variables from within a Perl program, so you'll have to do that as a one-liner
Update:
Damn it, its INCLUDE, not PATH
In reply to Re: string manipulation
by FunkyMonk
in thread string manipulation
by Noame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |