in reply to Name Me! MixMatch?

Your function computes the cartesian product, why not name it after that? Math::CartesianProduct, maybe?

While on the subject, IWBNI you featured a tied-filehandle interface, which would let me tie a filehandle to Math::CartesianProduct, then read it instead of using your next method.

Replies are listed 'Best First'.
Re: Re: Name Me! MixMatch?
by jackdied (Monk) on Dec 19, 2001 at 14:31 UTC
    Very cool. If I had only know that before, I wouldn't have had to write it :p
    Also, can reading from a file handle return non-scalars?

    -jackdied

      Reading from a file handle returns either a scalar, if you're doing something like "$x = <FH>", or a list, if you're doing something like "@x = <FH>". These are the only 2 contexts (scalar context and list context) available in Perl (well, there's also a void context, if you're really picky).

      But I don't think that's what you're asking. If you meant "can reading from a file handle return non-strings", the answer is also positive. Your READLINE method can return any scalars it likes. A list reference is just a scalar, so it could return a list reference in scalar context and a list of list references in list context. Just like any Perl function, really.