File: RPC.pm

package info (click to toggle)
libace-perl 1.92-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,608 kB
  • ctags: 1,541
  • sloc: perl: 7,763; ansic: 7,420; makefile: 84
file content (47 lines) | stat: -rw-r--r-- 801 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package Ace::RPC;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);

use Carp 'croak';
require Exporter;
require DynaLoader;

@ISA = qw(Exporter DynaLoader);

# Items to export into callers namespace by default.
@EXPORT = qw();

# Optional exports
@EXPORT_OK = qw(
	ACE_INVALID
	ACE_OUTOFCONTEXT
	ACE_SYNTAXERROR
	ACE_UNRECOGNIZED
	ACE_PARSE
);

$VERSION = '1.00';

sub AUTOLOAD {
  my $constname;
  ($constname = $AUTOLOAD) =~ s/.*:://;
  my $val = constant($constname, 0);
  if ($! != 0) {
    if ($! =~ /Invalid/) {
      $AutoLoader::AUTOLOAD = $AUTOLOAD;
      goto &AutoLoader::AUTOLOAD;
    }
    else {
      croak "Your vendor has not defined constant $constname";
    }
  }
  eval "sub $AUTOLOAD { $val }";
  goto &$AUTOLOAD;
}

bootstrap Ace::RPC $VERSION;

1;

__END__