http://qs321.pair.com?node_id=322600


in reply to Re: Re: IO::Socket::UNIX close() discards data when called "too soon"?
in thread IO::Socket::UNIX close() discards data when called "too soon"?

The server reads from the client with the following line in do_something():

my ($l) = <$fh>;

That is not a list assignment. If you want to read all of the data from the client, try adding local $/ = undef; before the above line.

90% of every Perl application is already written.
dragonchild

Replies are listed 'Best First'.
Re: Re: Re: Re: IO::Socket::UNIX close() discards data when called "too soon"?
by ddzeko (Acolyte) on Jan 20, 2004 at 16:00 UTC

    It was the uncaught SIGPIPE. Adding undef $/; to client solved the problem. Thanks!

Re: Re: Re: Re: IO::Socket::UNIX close() discards data when called "too soon"?
by Anonymous Monk on Jan 20, 2004 at 16:21 UTC
    perl -MO=Concise,-exec -e 'my ($l) = <$fh>' 1 <0> enter 2 <;> nextstate(main 1 -e:1) v 3 <0> pushmark s 4 <#> gvsv[*fh] s 5 <1> readline[t3] lK*/1 6 <0> pushmark s 7 <0> padsv[$l:1,2] lPRM*/LVINTRO 8 <2> aassign[t4] vKS 9 <@> leave[1 ref] vKP/REFC perl -MOpcode -le 'print Opcode::opdesc("aassign")' list assignment