in reply to (Ovid -Golf) Re(3): How do you chomp your chomps?
in thread How do you chomp your chomps?
All fine and good while $/ is \n. Dunno about you :), but I've been known to change it now and then:
sub my_chomp { substr shift, 0, ((length) = length($/)) if $_[0] =~ /$\$/};
Untested, but I would like to point out that the regex is pretty.
|
---|
In Section
Seekers of Perl Wisdom