in reply to Contents of file not printed to STDOUT

You've solved the immediate problem, but there are a few things that can be done to improve the code:

Always use strictures (use strict; use warnings;).

Use the three parameter version of open and lexical file handles:

open my $inFile, '<', $filename or die "Failed to open $filename: $!";

Note that $filename doesn't need to be interpolated into a double quoted string - it's fine just as it is.

If you don't chomp the line you just read you don't need to append \n in the following print statements.

True laziness is hard work