Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by Ovid (Cardinal)
on Jan 09, 2001 at 04:55 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://50603]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-18 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found