diff -r 8ff464fb8b9c -r 187c6026c574 plugins/perl/common/Gaim.pm --- a/plugins/perl/common/Gaim.pm Sat Aug 23 23:09:14 2003 +0000 +++ b/plugins/perl/common/Gaim.pm Sun Aug 24 01:08:32 2003 +0000 @@ -3,8 +3,10 @@ use 5.008; use strict; use warnings; +use Carp; require Exporter; +use AutoLoader; our @ISA = qw(Exporter); @@ -27,6 +29,25 @@ our $VERSION = '0.01'; +sub AUTOLOAD { + # This AUTOLOAD is used to 'autoload' constants from the constant() + # XS function. + + my $constname; + our $AUTOLOAD; + ($constname = $AUTOLOAD) =~ s/.*:://; + croak "&Gaim::constant not defined" if $constname eq 'constant'; + my ($error, $val) = constant($constname); + if ($error) { croak $error; } + { + no strict 'refs'; + + *$AUTOLOAD = sub { $val }; + } + + goto &$AUTOLOAD; +} + require XSLoader; XSLoader::load('Gaim', $VERSION); @@ -79,7 +100,7 @@ =head1 AUTHOR -Christian Hammond, Echipx86@localdomainE +Christian Hammond, Echipx86@gnupdate.orgE =head1 COPYRIGHT AND LICENSE