That code stores in $1 a copy of $b with everything after the last "_" removed, including the "_" itself.
There are exceptions.
$1 is left unchanged if $b contains no "_".
$1 is left unchanged if $b contains nothing before the last "_".
$1 is left unchanged if $b contains nothing after the last "_".
When executed in list context, it returns $1 on match or an empty list on failure to match.
In reply to Re: What this pattern matches
by ikegami
in thread What this pattern matches
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |