fork download
  1. use 5.008_008;
  2. use warnings;
  3.  
  4. # Function Name: 'usage'
  5. # Function Inputs: 'none'
  6. # Function Returns: 'none'
  7. # Function Description: 'Prints usage on STDERR, for when invalid options are passed'
  8. sub usage ## no critic qw(RequireArgUnpacking)
  9. {
  10. require File::Basename;
  11. my $PROG = File::Basename::basename($0);
  12. for (@_)
  13. {
  14. print {*STDERR} $_;
  15. }
  16. print {*STDERR} "Try $PROG --help for more information.\n";
  17. exit 1;
  18. }
  19.  
  20. usage();
  21.  
  22. END {
  23. use Test::More;
  24. ok($?);
  25. done_testing();
  26. }
Runtime error #stdin #stdout #stderr 0.03s 6752KB
stdin
Standard input is empty
stdout
ok 1
1..1
stderr
Try prog.pl --help for more information.
# Looks like your test exited with 1 just after 1.