陈钢
and 1 contributors

NAME

Carp::Perror - print msg then exit

SYNOPSIS

  use Carp::Perror qw/perror pexit/;
  pexit(1, "wrong argv given\n");
  # got "wrong argv given", exit code = 1;

  pexit("wrong argv given\n");
  # got "wrong argv given", exit code = 0;

  perror(1, "wrong argv given\n");
  # got "wrong argv given", exit code = 1;

  perror("wrong argv given\n");
  # got "wrong argv given", exit code = 0;

DESCRIPTION

Exit without any stack backtrace msg.

EXPORT

None by default.

METHODS

pexit()

exit with defined exit code if the first argv is a number.

else exit with 0.

perror()

just a alias of pexit().

SEE ALSO

Carp

AUTHOR

Chen Gang, <yikuyiku.com@google.com>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Chen Gang

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.2 or, at your option, any later version of Perl 5 you may have available.