projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moan about and then delete empty message files
[spider.git]
/
perl
/
Prefix.pm
diff --git
a/perl/Prefix.pm
b/perl/Prefix.pm
index 41a95db8086ec106eec66a102ecda92324727497..263f5f82d138f42594a2cad27c98f8f6eef89a24 100644
(file)
--- a/
perl/Prefix.pm
+++ b/
perl/Prefix.pm
@@
-200,6
+200,9
@@
sub AUTOLOAD
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$valid{$name};
$name =~ s/.*:://o;
confess "Non-existant field '$AUTOLOAD'" if !$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}} ;
if (@_) {
$self->{$name} = shift;
}
if (@_) {
$self->{$name} = shift;
}