On Mon, 2003-12-15 at 16:09, Stas Bekman wrote: > Philippe M. Chiasson wrote: > > On Sun, 2003-12-14 at 18:33, Stas Bekman wrote: > > > >>The following is yet another attempt to avoid collisions between > >>Apache::compat and the real mp2 APIs. > [...] > >>+} > >>+EOI > >>+ > >>+ 'Apache::RequestRec::finfo' => <<'EOI', > >>+{ > >>+ require APR::Finfo; > >>+ my $finfo_sub = *APR::Finfo::finfo{CODE}; > >>+ sub Apache::RequestRec::finfo { > >>+ my $r = shift; > >>+ stat $r->filename; > >>+ \*_; > >>+ } > >>+ $finfo_sub; > >>+} > >>+EOI > >>+); > > > > > > Why make this code a SCALAR, instead of creating an anonymous sub right > > there? > > What do you mean?
I meant: 'Apache::RequestRec::finfo' => sub { require APR::Finfo; my $finfo_sub = *$APR::Finfo::finfo{CODE}; *Apache::RequestRec::finfo{CODE} = sub { my $r = shift; stat $r->filename; \*_; } return $finfo_sub; } } That way, in mp2_override_api() you don't have to do that extra eval, and can just call this anonsub directly, no ? > > __________________________________________________________________ > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- -------------------------------------------------------------------------------- Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B) http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5 Q: It is impossible to make anything foolproof because fools are so ingenious. perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'
signature.asc
Description: This is a digitally signed message part