use Test::Simple tests => 3; ok !open(my $fh, '|-', 'nonexistent program'), 'string form of open fails'; ok open(my $prince, '|-', 'nonexistent program 2>/dev/null'), 'but succeeds if shell uses redirection'; ok !open(my $none, '|-', 'nonexistent', 'program'), 'list form of open fails, as it should'; __END__ 1..3 ok 1 - string form of open fails ok 2 - but succeeds if shell uses redirection ok 3 - list form of open fails, as it should