in reply to "perl -c" an array of code in a running program
You could try wrapping the array code into a subroutine and evaling it to detect errors:
my @code = ...; my $sub = join "\n", 'use strict;', 'use warnings;', 'sub test {', @co +de, '} 1;'; if( eval $sub != 1 ) { ## look in $@ for errors; }
|
|---|