Thursday, September 25, 2014

Clogged

This one had me stumped for a while:
#!/usr/bin/perl

use 5.014;
use autodie;

open FALSE, "|-", "false";
print FALSE "Hello world!";
say "Closing filehandle:";
close FALSE or die "close() doesn't die...";
say "...but doesn't succeed either";
What made it even confusing was that commenting out autodie allowed close to at least (silently) fail and return a false value (without even an error message in $! as would be expected).  I used autodie to catch any unchecked errors, dammit, not to hide them even further!

I guess that's what I get for living a life sheltered away from the raw, bare-metal, non-child-proof world of C programming.  :)

1 comment:

yarboberhaus said...

fun88 casino slot machines【WG98.VIP】
Fun88 fun88 soikeotot casino slot machines【WG98.VIP】 【 Best Online Casinos】play free slots. Fun88 has launched ボンズ カジノ the world's first 메리트 카지노 쿠폰 online casino site.