in reply to I'm having a strange bug with basic file input. I'm a total newb.

There are many things "wrong", or at least sub-optimum. First, always use strictures (use strict; use warnings;). Those will pick up a whole slew of errors related to typos and brain farts.

Use the three parameter version of open and lexical variables (open my $inFile, ...) for file handles.

Use indentation to show the block structure of your code:

... while (...) { ... } ...

You might like to point your teacher to PerlMonks. If your code is a faithful rendition of your teacher's style then the advice above applies to your teacher too!


Perl's payment curve coincides with its learning curve.