in reply to OOP Question - location of $self

(Sorry about posting anon, my net connection is in sad shape right now and so I am using lynx.)

Your example does have something seriously wrong with it. If you call the constructor multiple times, you will return the same object each time. You want multiple $self's. Take care of that and this will work, but with all of the usual caveats about using cheap globals for passing params. (You just made one of the classic mistakes associated with that.)

So bad style, but it can work.

  • Comment on Re (tilly) 1: OOP Question - location of $self