in reply to Parentheses missing around "my" list

Some other ways beside the already mentioned to avoid the error:
open my $file, +$filename; open my $file => $filename; open my $file, do {$filename}; my $file; open $file, $filename;

Replies are listed 'Best First'.
Re^2: Parentheses missing around "my" list
by davido (Cardinal) on Jul 27, 2011 at 20:36 UTC
    open my $file, do {$filename};

    I'm glad I had a mild lunch.


    Dave

      That is totally awesome, y'all, thanks!

      As usual, it turns out that shortcuts I take during "development" are more trouble than their worth. Leaving off error handling for opening the file, not using the three argument version of open--both things I know perfectly well are best practice.

      Still, very educational, thanks again!