When parsing an open my $fh ... function without parenthesis, PPI does not identify the $fh as a variable (PPI::Statement::Variable) but as a symbol instead (PPI::Token::Symbol).
Example:
use strict;
use warnings;
use PPI::Dumper;
use PPI::Document;
print "call open() with parenthesis\n";
my $doc_good = PPI::Document->new(\'open(my $foo, "<", "/etc/motd");');
PPI::Dumper->new($doc_good)->print;
print "call open() with NO parenthesis\n";
my $doc_bad= PPI::Document->new(\'open my $foo, "<", "/etc/motd";');
PPI::Dumper->new($doc_bad)->print;
When parsing an
open my $fh ...
function without parenthesis, PPI does not identify the$fh
as a variable (PPI::Statement::Variable
) but as a symbol instead (PPI::Token::Symbol
).Example:
Output: