in reply to calculate sum of numbers inside a text file
while (<>) { chomp; next unless length; if ($_ < 0) { push @negatives, $_; } else { push @positives, $_; } }
Update: This code was posted before the OP added code to his post.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: calculate sum of numbers inside a text file
by CR18 (Initiate) on Sep 27, 2015 at 05:01 UTC | |
by CR18 (Initiate) on Sep 27, 2015 at 05:58 UTC | |
by davido (Cardinal) on Sep 27, 2015 at 06:16 UTC | |
by parv (Parson) on Sep 27, 2015 at 08:51 UTC |