in reply to Re^3: trapping -w warnings
in thread trapping -w warnings

AFAIK $SIG{__WARN__} is only ever called with one parameter: the current warning. So your loop is most likely useless.

You can print each warning as it comes along. But what I did was collect the warnings first so you can print them out as a block. That may be useful if you want just one block, for example when printing warnings in a HTML page on a web server.