in reply to capturing STDERR within a script

If all you want is capture the warnings, setting $SIG{__WARN__} might do... STDERR doesn't allow itself to be tied so easily, especially for system messages.
my @warnings; $SIG{__WARN__} = sub { push @warnings, shift; };