+14Jan03=======================================================================
+1. Tidy up AUTOLOAD functions
+2. Make sure that empty PC16s are not sent on startup to a node.
12Jan03=======================================================================
1. add Czech language courtesy of Milan OK1XH
06Jan03=======================================================================
sub AUTOLOAD
{
no strict;
- my $self = shift;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
$name =~ s/^.*:://o;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
+ goto &$AUTOLOAD;
}
1;
#no strict;
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
+ goto &$AUTOLOAD;
}
#no strict;
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
+ goto &$AUTOLOAD;
}
1;
#no strict;
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
+ goto &$AUTOLOAD;
}
1;
# get all the users connected on the above nodes and send them out
foreach $node (@localnodes, @remotenodes) {
if ($node) {
- $self->send_route(\&pc16, 1, $node,
- map {my $r = Route::User::get($_); $r ? ($r) : ()} $node->users)
- if $self->user->wantsendpc16;
+ my @rout = map {my $r = Route::User::get($_); $r ? ($r) : ()} $node->users;
+ $self->send_route(\&pc16, 1, $node, @rout) if @rout && $self->user->wantsendpc16;
} else {
dbg("sent a null value") if isdbg('chanerr');
}
#no strict;
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# if (@_) {
-# $self->{$name} = shift;
-# }
-# return $self->{$name};
+ goto &$AUTOLOAD;
}
#use strict;
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
- &$AUTOLOAD($self, @_);
+ goto &$AUTOLOAD;
}
#
sub AUTOLOAD
{
-# no strict "refs";
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
+ goto &$AUTOLOAD;
}
1;
#
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
- *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
- &$AUTOLOAD($self, @_);
+ *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}};
+ goto &$AUTOLOAD;
-# @_ ? $self->{$name} = shift : $self->{$name} ;
}
1;
sub AUTOLOAD
{
no strict;
-
- my $self = shift;
- $name = $AUTOLOAD;
+ my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
- $name =~ s/.*:://o;
+ $name =~ s/^.*:://o;
confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
-# print "AUTOLOAD: $AUTOLOAD\n";
-# *{$AUTOLOAD} = sub {my $self = shift; @_ ? $self->{$name} = shift : $self->{$name}} ;
- @_ ? $self->{$name} = shift : $self->{$name} ;
+ *$AUTOLOAD = sub {$_[0]->{$name} = $_[1] if @_ > 1; return $_[0]->{$name}};
+ goto &$AUTOLOAD;
}
1;
sub AUTOLOAD
{
no strict;
-
- my $self = shift;
- $name = $AUTOLOAD;
- return if $name =~ /::DESTROY$/;
- $name =~ s/.*:://o;
+ my ($pkg,$name) = $AUTOLOAD =~ /^(.*)::(\w+)$/;
+ return if $name eq 'DESTROY';
confess "Non-existant field '$AUTOLOAD'" unless $valid{$name} || $Route::valid{$name};
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
-# *{$AUTOLOAD} = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
- @_ ? $self->{$name} = shift : $self->{$name} ;
+ *$AUTOLOAD = sub {$_[0]->{$name} = $_[1] if @_ > 1; return $_[0]->{$name}};
+ goto &$AUTOLOAD;
+# *{"${pkg}::$name"} = sub {$_[0]->{$name} = $_[1] if @_ > 1; return $_[0]->{$name}};
+# goto &{"${pkg}::$name"};
}
1;