source: branches/stable/PERL_SCRIPTS/lib/tools.pm

Last change on this file was 11762, checked in by westram, 10 years ago
  • move tools.pm into a separate perl lib dir
File size: 1.2 KB
Line 
1# =============================================================== #
2#                                                                 #
3#   File      : tools.pm                                          #
4#   Purpose   :                                                   #
5#                                                                 #
6#   Coded by Ralf Westram (coder@reallysoft.de) in October 2006   #
7#   Institute of Microbiology (Technical University Munich)       #
8#   http://www.arb-home.de/                                       #
9#                                                                 #
10# =============================================================== #
11
12package tools;
13
14use strict;
15use warnings;
16
17BEGIN {
18  use Exporter ();
19  our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS);
20  $VERSION     = 1.00;
21  @ISA         = qw(Exporter);
22  @EXPORT      = qw(
23                    &dieOnError
24                    &expectError
25                   );
26  %EXPORT_TAGS = qw();
27  @EXPORT_OK   = qw();
28}
29
30use ARB;
31
32sub dieOnError($$) {
33  my ($err,$where) = @_;
34  if ($err) { die "Error at $where: $err\n"; }
35}
36
37sub expectError($) {
38  my ($where) = @_;
39  my $err = ARB::await_error();
40
41  dieOnError($err,$where);
42}
43
441;
Note: See TracBrowser for help on using the repository browser.