Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.

Comment on Re: (Ovid -Golf) Re(3): How do you chomp your chomps?
Download Code

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 browsing the Monastery: (11)
As of 2016-02-11 20:00 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (379 votes), past polls