Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://50631]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-10-26 15:36 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (342 votes). Check out past polls.