Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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??


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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2015-07-03 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls