in reply to Chomp Command

By default, chomp returns the number of newline characters it removed. To view the number returned, store it into a scalar variable, as you would any other function in Perl. You can prove this to yourself by writing some code, such as:
use strict; use warnings; my $x = "foo\n"; my $count = chomp $x; print "$count\n"; my @arr = ("bar\n", "boo\n"); $count = chomp @arr; print "$count\n"; __END__ Prints out: 1 2

Before you ask any more questions, write some code, run the code, and see if you understand the results.

Replies are listed 'Best First'.
Re^2: Chomp Command
by sarathi.mh (Initiate) on Sep 17, 2010 at 18:53 UTC

    Thanks a lot