You have declared the filehandle used in "open" (my $fh) -
in reply to Parsing Multiple Lines.
That makes $fh a Symbolic reference to the file handle, and I don't believe you are trying to do that - more likely, this is a result of misunderstanding the statement in the doc:
If FILEHANDLE is an undefined lexical (my) variable the variable is assigned a reference to a new anonymous filehandle....
Juse use an UNDEFINED name like FH (No dollar), and you'll be OK.
Update: OK - seems like I need to re-read the docs myself. See notes below.
Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.