in reply to capturing STDERR within a script

The solution is, as has been pointd out, to redefine the WARN signal handler.

To redirect warnings for the command

my $allofit = buildData(\%Edina::SSR::Common::everything);
I simply created a subroutine:
sub makeData { my @warns = (); local $SIG{__WARN__} = sub { push @warns, @_; }; my $allofit = buildData(\%Edina::SSR::Common::everything); return ($allofit, \@warns); }
and called it with:
my ($allofit, $error) = makeData();
then the value of $error->... can be tested for any warnings



-- Ian Stuart
A man depriving some poor village, somewhere, of a first-class idiot.