Why are you returning sub refs? Try this instead:
use strict; use warnings; use Test::More tests => 1; sub mycheck { open( FH, '>', '/tmp/x/logfile' ) or return 1; foreach my $line (<DATA>) { print FH $line or return 2; } close FH; return 0 } my $return = mycheck(); is $return, 0, "got expected return value: $return"; __DATA__ dr_test_class ;; empty ;; empty ;; empty ;; empty dr_test_kept ;; handle_dr_test ;; /etc/dr_test ;; ;; kept ;; mojolicio +us
Ahhhh, much better! :)
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Getting stderr from a test::simple
by jeffa
in thread Getting stderr from a test::simple
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |