in reply to Re^2: store a warning in a variable
in thread store a warning in a variable

You are right. It even becomes much simpler:
my $warning; $SIG{__WARN__} = sub {$warning = shift};

Replies are listed 'Best First'.
Re^4: store a warning in a variable
by 7stud (Deacon) on Nov 10, 2010 at 01:43 UTC
    You are right.

    No, it wasn't a rhetorical question. I thought you were going to have an explanation for me.

    Thanks :)