--- Michael Fowler <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 12, 2001 at 09:31:08AM +0200, Ela Jarecka wrote:
> > In my code, I finally wrote:
> > 
> > foreach my $item ( keys %$reqrec ) {
> > ...
> > }
> 
> If that's how you want to design your class to be used it's up to
> you, but keep in mind that it breaks encapsulation.  Judging from
this
> what you really want is just a plain hash, not an object.  I would
> still suggest going with the myflds() method I showed you earlier;
> that way if you ever decide to change the hash myflds() returns you
> can easily do that, whereas with your %$reqrec you have to change all
> of the code using the hash. 

Ditto.
If you just want an anonymous hash reference, you don't have to bless
it to get that functionality. The main reason for a class is to have
methods. If you're making methods, put the code into the class, and
just call it as a method when you need it.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to