in reply to Re^2: stderr, local block and redirection
in thread stderr, local block and redirection

Although it's not explicitly explained that I can find, my guess would be that under the hood it needs an actual not-undef SvPV* into which the data is written. Otherwise it's going to be trying to append things to the single global undefined value &PV_sv_undef which is what throws the error.

Replies are listed 'Best First'.
Re^4: stderr, local block and redirection
by ikegami (Patriarch) on Sep 13, 2006 at 18:30 UTC
    I think the buffer for read and for sysread must be similarly initialized.
    my $read = read($fh, my $buf='', $MAX_READ);
Re^4: stderr, local block and redirection
by jfroebe (Parson) on Sep 13, 2006 at 18:21 UTC

    That makes perfect sense :) Interesting that it only occurs after the first occurance of the code. Into the bowels of the Perl engine I dare not go without asbestos lined bloomers. ;-)

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1