in reply to Recognizing Perl in text
This is from a memory of a discussion I couldn't find and this is just an outline but I think it'll work and be safe (someone will surely shoot that down if it's wrong).
# Read the file. # Inject 'BEGIN { exit }' at the beginning. # Run 'perl -ce' on the text. # Catch the output (eg, IO::CaptureOutput, Capture::Tiny). # Look for "syntax OK"
As mentioned, there are a few things that might not actually be Perl that'll parse fine as Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Recognizing Perl in text
by Anonyrnous Monk (Hermit) on Jan 06, 2011 at 16:11 UTC | |
by Your Mother (Archbishop) on Jan 06, 2011 at 16:58 UTC |