Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by pfaut (Priest)
on Jan 20, 2004 at 15:15 UTC ( [id://322600]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://322600]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found