I have a long time issue, off and on, of receiving this error. Inevitably, it's when I'm opening a lexical file handle like this:
open my $file, $filename;
And I mean that literally, as in I use a scalar that contains the filename. Sometimes--but not usually--I get an error like:
Parentheses missing around "my" list at ./protcpdump.pl line 40.
I can "fix" this by merely putting the filename scalar in quotes:
open my $file, "$filename";
I know I'm missing something, but for the life of me I can't find the common denominator in the situations where this happens. What am I missing?
Any input would be greatly appreciated! (I hate not really understanding errors like this).