>> $tmp =~ s/^([A-Za-z]+_)(.*)/\2/;
>>
>> I think the problem is that \w matches an underscore also, and the regexp
>> is being greedy as well.  There's probably an even better way to do it
>> (especially if your strings have foreign characters at it), but that was
>> what occurred to me off the top of my head.

You're doing too much work here.  Instead of saying "remove these
characters", you're saying "get these characters, and those characters,
and replace the entire string with those characters."

You're also using \2 on the right-hand side (RHS) of a s///, which is not
safe.  You should use $2.

  s/^[A-Za-z]+_//;

does far less work.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734

Reply via email to