in reply to Substitution Operator
...moreover, you are not reading the whole file, you are just reading the first line.. the <FILEHANDLE> operator returns a single line if it is expected to return a scalar, and a list in list context.. so to read all your file, you must read it into an array: @lines = <FILE>; then iterate over that array..
The array is split with the $/ variable. which is \n by default.. you can undef this variable to read the whole file as a single string.
this will read all the text into a single variable...{ local $/; $text = <FILE>; }
you should look into what solution suits you better.
|
|---|