On 9/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,What're the meanings of this routine and why people need it?
> Thanks.
snip
It is a nasty bit of code that creates an accessor/mutator function
for a given attribute/member/whatever-oo-people-call-their-data-in-a-object
if an method w
sorry send it again with plain text.
sub make_accessor {
my($package, $name) = @_;
no strict qw(refs);
my $code = <{$name} = $value;
}
if(exists $self->{$name}) {
return ($self->{$name});
} else {
return "";
Hello,What're the meanings of this routine and why people need it?Thanks.sub
make_accessor {my($package, $name) = @_;no strict qw(refs);my $code =
<{$name} = \$value;}if(exists
\$self->{$name}) {return (\$self->{$name});} else {return "";}}EOTif(! defined
*{"$package\::$name"}) {eval $code or d