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 };