while (my $line = <$INPUT>) {
#chomp; # this gives me syntax errors???
...
}
The chomp; statements in the code in this post operate on the default $_ scalar, which does not seem to be initialized anywhere in the code. Let me suggest that what you are seeing is not a syntax error but a "Use of uninitialized value ..." warning (not an error) because you have very wisely enabled warnings in your code.
A solution is to chomp something that has been assigned a value, like $line in the while-loop conditional expression:c:\@Work\Perl\monks>perl -wMstrict -le "chomp; " Use of uninitialized value $_ in scalar chomp at -e line 1.
Give a man a fish: <%-{-{-{-<
In reply to Re^5: divide multi-column input file into sub-files depending on specific column's value
by AnomalousMonk
in thread divide multi-column input file into sub-files depending on specific column's value
by angela2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |