in reply to OOP Question - location of $self
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.
|
|---|