Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 romping around the Monastery: (10)
As of 2014-11-26 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls