![]() |
|
more useful options | |
PerlMonks |
Re: (Ovid -Golf) Re(3): How do you chomp your chomps?by chromatic (Archbishop) |
on Jan 09, 2001 at 10:15 UTC ( #50631=note: print w/replies, xml ) | Need Help?? |
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
|
|