Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

(Ovid -Golf) Re(3): How do you chomp your chomps?

by Ovid (Cardinal)
on Jan 09, 2001 at 04:55 UTC ( #50603=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub my_chomp { substr shift, 0, (length) - 1 if $_[0] =~ /\n$/}; # :-)
    
  2. or download this
    sub my_chomp { wantarray ? (map{ /\n$/ ? substr $_, 0, (length)-1 : $_
    + } @_) 
                             : chomp(my $x = shift),$x };
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2015-07-28 20:19 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 (258 votes), past polls