I am not sure what you are doing, but based on the code
above, you should make sure you declare your variables when
using 'use strict'. You never declared $infilename,
$currentLine, or $name.
Again, in the code above, you never opened IN or OUT.
Yet again, you never grabbed the user-entered text using
the STDIN filehandle.
If you are just going to use the lines from IN in that
'while' loop, you could just: