in reply to using Open
When you say open $info, $file $info gets to hold the filehandle, not the content of the file. When you print it, its value becomes stringified.
What you want is to read from the file, and read that. To avoid reading the whole file to memory at once, let's do it line by line using the <> operator:
More details in perlopentut.while (<$info>) { # $_ holds a line print; # print w/o arguments prints $_ }
|
|---|