in reply to howto parse (or determining end) of a line of perl
I think I remember LanX talking about a REPL of his where a new line would be prompted and concatenated to the current statement until it did compile. To check for compilation without actually executing anything you can do something like: eval "sub DUMMY { $code }; 1" or die "Failed! $@". Any use statment or BEGIN block will still be executed though.
Of course this requires a way to cancel the current input, maybe with an EOF token in Linux, or anything that you are not going to put in actual perl code.
Edit: rephrased the first sentence for clarity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: howto parse (or determining end) of a line of perl
by perl-diddler (Chaplain) on Aug 26, 2016 at 00:28 UTC | |
by RonW (Parson) on Aug 26, 2016 at 19:19 UTC |