Bah. Thanks to Abigail. I'd done it as open ... || die ... and that hadn't worked, but that was because the || was binding more tightly than the open; open (...) || die works perfectly well. I really must get that faster brain...