rastoboy has asked for the wisdom of the Perl Monks concerning the following question:
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:
And I mean that literally, as in I use a scalar that contains the filename. Sometimes--but not usually--I get an error like:open my $file, $filename;
I can "fix" this by merely putting the filename scalar in quotes:Parentheses missing around "my" list at ./protcpdump.pl line 40.
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?open my $file, "$filename";
Any input would be greatly appreciated! (I hate not really understanding errors like this).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parentheses missing around "my" list
by davido (Cardinal) on Jul 27, 2011 at 19:39 UTC | |
|
Re: Parentheses missing around "my" list
by Tanktalus (Canon) on Jul 27, 2011 at 19:41 UTC | |
|
Re: Parentheses missing around "my" list
by ikegami (Patriarch) on Jul 27, 2011 at 19:43 UTC | |
|
Re: Parentheses missing around "my" list
by a (Friar) on Jul 27, 2011 at 19:56 UTC | |
|
Re: Parentheses missing around "my" list
by JavaFan (Canon) on Jul 27, 2011 at 20:08 UTC | |
by davido (Cardinal) on Jul 27, 2011 at 20:36 UTC | |
by rastoboy (Monk) on Jul 28, 2011 at 14:46 UTC |