Re: question about a routine

2007-09-04 Thread Chas Owens
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

Re: question about a routine (send again)

2007-09-03 Thread kenpeng
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 "";

question about a routine

2007-09-03 Thread kenpeng
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