In article
<[EMAIL PROTECTED]>, Rob
Hanson wrote:

>> But I'm wondering if there is another way
>> (like the Java "private variable") to say
>> "all class variables declared here are unique
>> to each instance"?
> 
> It sounds like you are trying to link how OO-Perl works with OO-Java...
> and
> that is only going to make your head spin.  What you really need to do is
> understand what bless really does, and that OO-Perl isn't really OO in the
> usual sense (but it works like it is).
[...]

> Now when you talk about instance variables, realize that there is no true
> object instance in Perl.  It is just a reference tagged with a "type"...
> the rest is all smoke and mirrors.
> 
> So to emulate instance variables you can use a hash reference instead of
> a scalar reference, like this:

And this actually works quite fine I think...

> I hope that helps a little.
> 
> Rob

Thanks, that helped a lot! (Thank you also to others who responded.)

Meanwhile my "naive ticketMachine" is chugging along. And I like doing the
Perl version of something else; it's good practice for me (though I'm
getting tired of typing "my $self = shift;").  ;-)

-K

-- 
Kevin Pfeiffer
International University Bremen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to