projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a pretty nearly working gtkconsole...
[spider.git]
/
perl
/
Route
/
User.pm
diff --git
a/perl/Route/User.pm
b/perl/Route/User.pm
index bcd98a00ed3e591c86a995ad3f8c8be1abebd794..86a50c044b7e2c48b61de1fe928fc97e10b8f05f 100644
(file)
--- a/
perl/Route/User.pm
+++ b/
perl/Route/User.pm
@@
-14,10
+14,8
@@
use Route;
use strict;
use vars qw($VERSION $BRANCH);
use strict;
use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0;
-$main::build += $VERSION;
-$main::branch += $BRANCH;
+
+main::mkver($VERSION = q$Revision$);
use vars qw(%list %valid @ISA $max $filterdef);
@ISA = qw(Route);
use vars qw(%list %valid @ISA $max $filterdef);
@ISA = qw(Route);
@@
-53,7
+51,7
@@
sub new
my $self = $pkg->SUPER::new($call);
$self->{parent} = [ $ncall ];
my $self = $pkg->SUPER::new($call);
$self->{parent} = [ $ncall ];
- $self->{flags} = $flags;
+ $self->{flags} =
0 ||
$flags;
$list{$call} = $self;
return $self;
$list{$call} = $self;
return $self;
@@
-88,13
+86,19
@@
sub get
sub addparent
{
my $self = shift;
sub addparent
{
my $self = shift;
- return $self->_addlist('parent',
@_
);
+ return $self->_addlist('parent',
shift
);
}
sub delparent
{
my $self = shift;
}
sub delparent
{
my $self = shift;
- return $self->_dellist('parent', @_);
+ return $self->_dellist('parent', shift);
+}
+
+sub has_parent
+{
+ my $self = shift;
+ return $self->_haslist('parent', shift);
}
#
}
#
@@
-104,18
+108,17
@@
sub delparent
sub AUTOLOAD
{
no strict;
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
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;
}
1;