projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added better anti spot-sucking
[spider.git]
/
perl
/
Route
/
Node.pm
diff --git
a/perl/Route/Node.pm
b/perl/Route/Node.pm
index 1fbd8f71a291a1cddab0b6c71430bea16c1610cb..3c4addd01c841ab41d54c45c63e779c0cb734128 100644
(file)
--- a/
perl/Route/Node.pm
+++ b/
perl/Route/Node.pm
@@
-254,7
+254,7
@@
sub newid
if ($id > $self->{lid}) {
$self->{lid} = $id;
return 1;
if ($id > $self->{lid}) {
$self->{lid} = $id;
return 1;
- } elsif ($self->{lid} - $id >
600
00) {
+ } elsif ($self->{lid} - $id >
5
00) {
$self->{id} = $id;
return 1;
}
$self->{id} = $id;
return 1;
}
@@
-315,19
+315,16
@@
sub DESTROY
sub AUTOLOAD
{
no strict;
sub AUTOLOAD
{
no strict;
-
- my $self = shift;
- $name = $AUTOLOAD;
+ my $name = $AUTOLOAD;
return if $name =~ /::DESTROY$/;
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
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;
}
1;