in reply to hash keys, %

use array slices in combination with hash slices, thusly:
use strict; my @keys = keys %hash; my $span = 20; my ($page, $last_page) = (0, int($#keys / $span)); while ($last_page > 0 and $i < $last_page) { make_page($page, @hash{@keys[$i * $span .. (++$i) * $span - 1]}); } make_page($last_page, @hash{@keys[$last_page*span .. $#keys]});

Replies are listed 'Best First'.
Re: Re: hash keys, %
by cleverett (Friar) on Jul 29, 2003 at 00:43 UTC
    heh, I forgot about splice ...