Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
IO::Socket::UNIX plus syswrite plus eval fails?by cavac (Parson) |
on Jun 02, 2021 at 11:46 UTC ( [id://11133414]=perlquestion: print w/replies, xml ) | Need Help?? |
cavac has asked for the wisdom of the Perl Monks concerning the following question: Either i found a bug or i'm doing something incredibly stupid (my guess is the "stupidity"). I'm using a non-blocking client with IO::Socket::UNIX. Sometimes the script just exits without any error message, even though i'm trying to catch that specific case with an eval. Here is the relevant code:
Most of the time this works fine, but sometimes i just get:
And then i'm back at the command line without any additional message. Shouldn't eval catch any errors and prevent the script from exiting? If something goes wrong in syswrite, i'd expect an output like this:
What am i doing wrong here?
perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'
Back to
Seekers of Perl Wisdom
|
|