in reply to Re^2: An object replacing itself
in thread An object replacing itself

While I agree with dragonchild and diotalevi that you shouldn't do this, I'm not quite sure it's a terrible idea, per se. The only reason I would advise not to use it is, in Perl, there's a very common idiom for iterators:

my $notelist = My::Dashboard::Note->list; while (my $note = $notelist->next) {}

What you're trying to do may be common in VB-land, and there may be nothing inherently wrong with it, but you're not writing VB code. You're writing Perl code, and you should try to write things in a Perlish manner.

Replies are listed 'Best First'.
Re^4: An object replacing itself
by dragonchild (Archbishop) on Sep 24, 2004 at 00:23 UTC
    See my reply further on in this thread. Joel is discussing a hack to get around the poor interface of DAOs. I don't think he'd advocate this solution in the general sense.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

Re^4: An object replacing itself
by ryantate (Friar) on Sep 23, 2004 at 22:25 UTC

    Thank you for your input. I really appreciate it.

    I also agree there is value in writing code other Perl programmers can more easily understand. I'll have to give this all some thought.

    As far as doing things in Perlish manner, someone wise once told me There is More Than One Way To Do It ;->

    (PS I have no idea if this is common VB code. I haven't written a line of VB in my life.)

      Sure, there is more than one way to do it, but most of those are the wrong way. Jumping through hoops just to do it "a different way" is silly.