Skip to content

Commit

Permalink
fixed bug where a filehandle is seen as a file https://rt.cpan.org/Pu…
Browse files Browse the repository at this point in the history
  • Loading branch information
mirod committed Oct 5, 2014
1 parent 3f631e8 commit a8f9205
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Twig_pm.slow
Expand Up @@ -763,6 +763,7 @@ sub parse
if( !$t
&& $@=~m{(syntax error at line 1, column 0, byte 0|not well-formed \(invalid token\) at line 1, column 1, byte 1)}
&& -f $_[0]
&& ref( $_[0]) && ref( $_[0]) ne 'GLOB' # -f works on a filehandle, so this make sure $_[0] is a real file
)
{ croak "you seem to have used the parse method on a filename ($_[0]), you probably want parsefile instead"; }
return _checked_parse_result( $t, $@);
Expand Down

0 comments on commit a8f9205

Please sign in to comment.