in reply to HTML::Mason and long method call

I think some error should be logged to STDERR (apache error_log) and it isn't.

Looks to me like *somewhere* redirection of STDERR and/or STDOUT is done, and for some reason (code barfs out before?) the defaults aren't restored. Maybe you could dup STDERR and STDOUT into a SAVEOUT and SAVEERR filehandle before, and restore them after calling longfunction().

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: HTML::Mason and long method call
by themage (Friar) on Oct 23, 2006 at 12:21 UTC
    Hi shmem,

    The problem is not with my longfunction STDERR, or even with the mason STDERR. If inside my longfunction I print to STDERR I get the message in error_log, and the same happens when I print to STDERR after the call to this component.

    My problem is that Mason seems to terminate my component and behave like everything is ok.

    This component is not complemently run, but everything after its call in the caller is runned normally. My final page is created as if this component runned completly ok but didn't sent any output.

      Did you try to isolate where it stops printing inside of longfunction? Did you check if any error is being printed in the HTML output to the browser? (What is MasonErrorMode/error_mode?) What code is inside longfunction? Did you try the Mason mailing list? Also, looking in the MASON_DATA_ROOT at what the components get compiled into can help sometimes. What is your system (redhat?) ? What version of Mason?
        The system is a Fedora Core release 3 (Heidelberg), with Mason $HTML::Mason::VERSION = '1.34';

        The error_mode is the default and the code inside longfunction depends on the specific function, but is always calls to NET::Telnet->*, to execute commands on remote network hardware.

        The component compiles to expectable code, and works everytime the call to longfunction takes a bit less time.

        Didn't tried the Mason mailling list yet as I'm subscribed with an email I don't have configured in this computer. Gone try that later on my home computer.

        Thanks,