Please use <code> ... </code> tags around your code.
The file handle probably failed to open. Always test your opens for failure, for example: open ALLLOG, ">$ark2" or die "Unable to open $ark2: $!";
open SLOG, "$ark3" or die "Unable to open $ark3: $!";
The $! variable should give you the reason why it cannot open the file. | [reply] [d/l] |
And while preaching "Best practices" why not go all the way and do it as follows:
open my $ALLLOG, '>', $ark2 or die "Unable to open $ark2: $!";
open my $SLOG, '<', $ark3 or die "Unable to open $ark3: $!";
It employs lexical filehandles, uses the three arguiment version of open and does away with unnecessary double quotes.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [d/l] [select] |