in reply to Caller, caller, wherefore art thou, caller?

Would your original conundrum be fixed by
while (my ($key, $value) = $array->each) { last if some_condition($key, $value); } $array->reset_counter;
? Seems like good functionality for the object to have.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Caller, caller, wherefore art thou, caller?
by Ovid (Cardinal) on Oct 10, 2005 at 16:11 UTC

    I have a reset_each() method in the class, so yes, that would solve it. I was just hoping there was some "automatic" way of doing this.

    Cheers,
    Ovid

    New address of my CGI Course.

      I don't see what you are trying to gain. Can you show an example of how this is to be used?

      Be well,
      rir

        It's a long a rather complicated example. The main problem (not the only problem) is that I am implementing a REST interface and the path info is effectively a set of key/value pairs but ordering is important. Further, I need to sometimes insert default information before and after certain keys. I just need a simple interface which accomplishes this and tied hashes fail for a variety of reasons (not the least of which is the fact that I do not used tied variables unless I have no choice).

        Cheers,
        Ovid

        New address of my CGI Course.