in reply to Re: Getting stderr from a test::simple
in thread Getting stderr from a test::simple

I see. Would eval instead of sub be acceptable?

Neil Watson
watson-wilson.ca

  • Comment on Re^2: Getting stderr from a test::simple

Replies are listed 'Best First'.
Re^3: Getting stderr from a test::simple
by AppleFritter (Vicar) on Jul 01, 2014 at 18:26 UTC

    Acceptable, probably, but if you merely want to print a warning in addition to making the test fail, I'd say do is your best choice:

    open (FH, '>', '/tmp/x/logfile') or do { warn "Cannot open file [$!]"; return 1; };

    There may well be more idiomatic ways of doing (no pun intended) this that I'm not aware of. My monastic brothers will (probably) be happy to chime in!