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.

{ local $/; $text = <FILE>; }
this will read all the text into a single variable...

you should look into what solution suits you better.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/