in reply to Re^4: Ordering Template cards
in thread Ordering Template cards

Well it could have been designed to detect that it's called in list context and return an empty list when the table is exhausted.

There are arguments to be made for and against this. If a method is documented to return a scalar, then you'd expect to be able to do my %data = ( foo => $sth->fetchrow_arrayref, bar => 123 );, if it suddenly returns the empty list that'd be a problem.

Replies are listed 'Best First'.
Re^6: Ordering Template cards
by LanX (Saint) on Jan 26, 2021 at 12:41 UTC
    haukex++ That's a very good point!

    But IMHO the culprit here is the design of the fat comma => as pairing operator.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery