in reply to Re: Recognizing Perl in text
in thread Recognizing Perl in text

# Inject 'BEGIN { exit }' at the beginning. ...

But wouldn't that make any gibberish pass with "syntax OK"?

$ echo 'BEGIN { exit }' | cat - perl-5.12.2.tar.gz >foo $ perl -c foo foo syntax OK

Didn't know Perl is written in Perl ;)

Replies are listed 'Best First'.
Re^3: Recognizing Perl in text
by Your Mother (Archbishop) on Jan 06, 2011 at 16:58 UTC

    I think you're right! Sorry for that... you could do it without the block but it becomes less "safe" and side-effect free.