I recall I have seen one guy on
mason-users maillist who had similar problem with
IPC::Open2. I.e his code worked as script but didn't work under
HTML::Mason.
See
this thread. Proposed solution was replacing
IPC::Open2 with
IPC::Run.
--
Ilya Martynov
(http://martynov.org/)