jdgamache has asked for the wisdom of the Perl Monks concerning the following question:
well.... this validates the code all right! the problem is that it executes the perl code also ;) I need another way to check if the code is valid... but does not execute it. any ideas ?!? thanks! Jean-Daniel# check to see if code is valid sub check_valid_code { my ($lang, $code) = @_; if ($lang eq 'perl') { $code .= "\n1;\n"; return eval ($code); } 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check if perl code is valid
by merlyn (Sage) on Jan 15, 2001 at 00:00 UTC | |
by marius (Hermit) on Jan 15, 2001 at 04:03 UTC | |
by I0 (Priest) on Jan 15, 2001 at 05:35 UTC | |
|
Re: Check if perl code is valid
by I0 (Priest) on Jan 15, 2001 at 00:07 UTC |