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.
In reply to Re (tilly) 1: OOP Question - location of $self
by Anonymous Monk
in thread OOP Question - location of $self
by jeffa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |