in reply to Registry scripts using bless

It probably will work, at least it would work as well as any other subroutine does in a Registry script. However, it seems pretty strange to me, using an auto-generated package name and subs defined within other subs when doing OO. If you want to do OO, why don't you just use a PerlHandler? It's easy and saves you from questions likes this.

Replies are listed 'Best First'.
Re: Re: Registry scripts using bless
by Anonymous Monk on Nov 14, 2001 at 00:04 UTC
    These examples are from code written almost a year ago. Migrating from registry scripts to handlers is a "rainy-day" project (we have a very small team and LOT of work on our plate - all new development is done with PerlHandlers but we don't have time to rewrite old code). I was worried about the 'my' in particular because we all know the following is not good in mod_perl registry scripts:
    my $counter; &do_something; sub do_something { $counter++; }
     use vars '$counter' is needed to make this global... I was worried I would have to  use vars '$self' Since I'm using my $self = shift in the subroutines I figured things would be safe and wanted to double check with you folks. Thanks
      It should be okay. If you have problems, make sure you didn't miss any declarations of my $self in the subroutines.