in reply to need help on unopened file handle

Change your "while" line to read:
while (<$fh>) {
And uncomment the line that opens that filehandle.

The DATA filehandle usually refers to some embedded data at the end of the code, which starts after the __DATA__ line. It's quite often used in examples.

I suspect that you copied some code verbatim, without realising you needed to change that ;)

Cheers,
Darren :)