Subject: | "require" in expression parse as PPI::Statement::Include |
Date: | Sun, 08 Jun 2008 08:23:50 +1000 |
To: | bug-PPI [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In ppi 1.203 and the debian packaged perl 5.10 a line
eval { require IO::Socket::INET } || require IO::Socket;
parses as
PPI::Document
PPI::Statement
PPI::Token::Word 'eval'
PPI::Structure::Block { ... }
PPI::Statement::Include
PPI::Token::Word 'require'
PPI::Token::Word 'Foo'
PPI::Token::Operator '||'
PPI::Token::Word 'require'
PPI::Token::Word 'Bar'
PPI::Token::Structure ';'
where I expected the second "require" would be PPI::Statement::Include,
the same as the first.
Dunno if a require in an expression is a good idea, this one is from
Net::HTTP (in LWP).