in reply to removing the last word

Hi,

Depending on your certainty of always having /usr/local you can do:

bash-3.00$ perl -e '$p = "/usr/local/whatever"; if ( $p =~ /^\/usr\/lo +cal\/(.+)$/ ) { print $1."\n"; }'

Output:

whatever
--
if ( 1 ) { $postman->ring() for (1..2); }