in reply to Strawberry perl on Win 7 (64-bit)

You used the "program |" syntax, which makes the returned handle a pipe of the output of the program.

Change

my $infile = IO::File->new("c:\\...\\test.txt |");

to

my $infile = IO::File->new("c:\\...\\test.txt");