Re: chomp operator



I find chomp() usefull for processing a file, or other input (eg keyboard).

#!/usr/bin/perl
use strict;
use warnings;

while(<>) {
print "$_"; # $_ has a newline attached, either from file or STDIN
chmop;
doSomethingWithTheString($_);
}
.



Relevant Pages