I really like the Perl Email Project, in theory. Lately it's been getting my goat, due to weird interfaces, backwards compatibility glitches, and one particularly troublesome bug.
Tomorrow I plan to go on the offensive against Email::Send, trying to improve the interface, at least for my own benefit. I want to be able to specify the envelope sender and recipient, I more standard return values, and maybe just a more standard argument passing system. Simple is good, but I can't afford to box anything into something so simple as to be constrictive. Anyway, time will tell whether I should actually be worried. Hopefully just twenty-four hours will be enough.
Today's bug was a serious pain. Let me remind all you Perl programmers: if you print to a filehandle, check the result of print. If you didn't get a true value back from print, you didn't really put data in the file. Even if you could create the file and close the filehandle successfully, if you didn't print, you didn't deliver your mail!
Hopefully Email::LocalDelivery will soon be patched... and now I see that some other useful patches need to be applied, like the one to make Email::Send::SMTP fork-safe. Maybe tomorrow will be a good day for Perl Email, if I can get my butt in gear.
use fatal 'print'; ? (Score:1)
Wow! That's a surprise to me, and I certainly don't check the return value of print in my own code. I guess an easy way to bundle this up would be to make print fatal in a block that prints to file handles, and trap with eval? Are there other (better) ways to handle this?
osfameron
Re:use fatal 'print'; ? (Score:1)
perl -e'use Fatal qw(print);'
Cannot make a non-overridable builtin fatal at
Another thing worth remembering is print doesn't seem to return failure every time it fails. I think it returns success if you print to a file in a full filesystem ( or did when I checked on linux and hp a year or so ago ).
Re:use fatal 'print'; ? (Score:1)
Fortunately, I also patched to check that -s $file >= length $message.
rjbs
Re:use fatal 'print'; ? (Score:2)
Re:use fatal 'print'; ? (Score:1)
rjbs