I was notified that Mail::Sender (sending emails through SMTP via socket()s) doesn't work with Perl 5.8 with some SMTP servers if the script runs under Windows.
I tried to compile 5.8 myself (Win2k, perlio enabled) and used a TCP/IP sniffer to see what do I send to the server, and sure enough ... even though I do binmode($socket); the \x0D\x0A I send into the socket gets changed into 0D0D0A.
I tried to use binmode( $socket, ':raw:perlio') as well as binmode( $socket, ':raw'), but it did not change the results at all.
Adding
oruse open OUT => ':raw';
into the module did help though. Since I would like to be able to support 5.005, I cannot just add the use statement into the module, butuse open OUT => ':raw:perlio';
seems to work fine.BEGIN { if ($] >= 5.008) { require 'open.pm'; 'open'->import(OUT=>":raw:perlio"); } }
I'm also using
later though that's probably not necessary.binmode($s) unless ($] >= 5.008);
I don't like this solution though. Is there any other (better) way? What should I do?
Thanks, Jenda
In reply to Perl 5.8, sockets and binmode() by Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |