in reply to Re^4: variable interpolation
in thread variable interpolation

Use print instead of printf. printf takes a format string which is what was causing your grief. Any special characters you interpolate into the format string will be processed by the printf and parameters will be expected to match them. Strictures would have alerted you to the problem.

You should also always use the three parameter version of open and check the result. And you should use lexical file handles:

open my $inFile, '<', $filename or die "Couldn't open $filename: $!";

Oh, and don't use chop, use chomp instead.


True laziness is hard work