in reply to Re^2: working with files
in thread working with files

This is a problem:

while(IN){

It should be

while( <IN> ) {

If you had been using warnings you would have seen this message:

Bareword found in conditional at yourscript.pl line xx. Name "main::IN" used only once: possible typo at yourscript.pl line xx +.

And if you had been using strict, you would have seen this fatal message:

Bareword "IN" not allowed while "strict subs" in use at yourscript.pl +line xx. Execution of yourscript.pl aborted due to compilation errors.

It will really help you to keep on top of these hard to spot bugs if you remember to start every script off with:

use strict; use warnings;

Update: I believe someone already mentioned to you in an earlier thread that you should be using strictures and warnings. Strictures and warnings will cause Perl to complain when it encounters things that are probably bugs in your code (or at least bad practices). And all that noise is helpful in isolating and eliminating such bugs and bad practices.


Dave