Re: avoid errors when printing to socket

2021-10-02 Thread hw
On Fri, 2021-10-01 at 17:01 -0500, Andy Bach wrote: > > If the signal would be caught, I could handle the error and try to > reconnect, or, if that also fails, do something else. > > Oh. I was thinking you wanted it to check the connection before trying to > print. Well, the print stmt returning u

Re: avoid errors when printing to socket

2021-10-01 Thread Andy Bach
> If the signal would be caught, I could handle the error and try to reconnect, or, if that also fails, do something else. Oh. I was thinking you wanted it to check the connection before trying to print. Well, the print stmt returning undef will tell you the same thing. Hmm, it would appear print

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 '