Re: avoid errors when printing to socket

2021-09-30 Thread hw
On Thursday, September 30, 2021 9:30:01 PM CEST Andy Bach wrote: > > https://perldoc.perl.org/functions/print says that 'print' would return > > true > > > if successful and doesn't say what it returns otherwise. It also says > > that > > > "Printing to a closed pipe or socket will generate a

Re: avoid errors when printing to socket

2021-09-30 Thread Andy Bach
> https://perldoc.perl.org/functions/print says that 'print' would return true > if successful and doesn't say what it returns otherwise. It also says that > "Printing to a closed pipe or socket will generate a SIGPIPE signal." Looks like print returns 1 if it succeeds, undef if not: $ perl -wE '

avoid errors when printing to socket

2021-09-30 Thread hw
Hi, I have a program in which I'm creating an UDP socket with IO::Socket::INET to a device on my LAN. Opening the socket yields no error. Writing to the socket with 'print' works fine. The device sends data back, and receiving the data works fine. But it doesn't work when the device is offl