saintex has asked for the wisdom of the Perl Monks concerning the following question:
# and:chomp (my @lines=<STDIN>); my @due=sort @lines; print "@due\n";
The second one print a number. I think this number is the quantity of lines chomped (or the number of elements in array), but I don't understand why the two statments are different. Thank you!print sort chomp (my @lines=<STDIN>);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected chomp behavior
by almut (Canon) on Feb 05, 2010 at 08:37 UTC | |
|
Re: Unexpected chomp behavior
by ikegami (Patriarch) on Feb 05, 2010 at 08:50 UTC | |
|
Re: Unexpected chomp behavior
by johngg (Canon) on Feb 05, 2010 at 11:07 UTC | |
|
Re: Unexpected chomp behavior
by FunkyMonk (Bishop) on Feb 05, 2010 at 11:40 UTC | |
|
Re: Unexpected chomp behavior
by Anonymous Monk on Feb 05, 2010 at 08:25 UTC | |
|
Re: Unexpected chomp behavior
by JavaFan (Canon) on Feb 05, 2010 at 09:18 UTC | |
|
Re: Unexpected chomp behavior
by Anonymous Monk on Feb 05, 2010 at 09:53 UTC |