I greatly appreciate all the work developers do in preparing and releasing modules to CPAN - they've enabled me and everyone else here to get stuff done quickly and usually reliably.
But there's one thing in a lot of modules on CPAN that really worries me - too often I see stuff like this (XML::Smart in this case):
Why do so many authors fail to check for print failures (well ok, open and close failures in this case as well) to files?my $fh ; open ($fh,">$file") ; binmode($fh) if $unicode ; print $fh $data ; close ($fh) ;
I've even written to a couple of authors politely explaining that its useful to know when print is failing because your hard drive is full, but with no success.
I know you can force perl to die on such errors, but I would hope code going into CPAN modules would be doing stuff like:
I work on a lot of data processing scripts, and ignoring a write failure would probably get me the sack - but surely there are relatively few situations where data loss is acceptable?my $fh ; open ($fh,">$file") or dir "Failed to open: '$file' for write: $!"; binmode($fh) if $unicode ; print $fh $data or die "Failed to write to: '$file': $!"; close ($fh) or warn "Failed to close: '$file': $!";
Can monks suggest anything that can be done to get CPAN modules reviewed and fixed for such problems? I'm prepared to review the odd module or two, but not when I know half the time I'll get ignored by the module author (I'm not suggesting this is the case with XML::Smart BTW, I took this at random as an example!)
If what I'm saying is valid, is there some well known and respected name in the perl community who could write a small article (or I'll write it for them!) for perl.com discussing this - then I can point authors to such an article and they might take notice!
Thanks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |