At 16:22 2006-9-29, Charles K. Clarkson wrote:
Shiping Wang wrote:

    According to the code you provided, you are breaking up the
large array into smaller arrays like this:

print "Large array values become these subarrays:\n\n";

my @P = 1 .. 90;
foreach my $i ( 0 .. 9 ) {
    print "\t[";

    foreach my $value ( $P[$i], @P[8*$i+10 .. 8*$i+17] ) {
        printf '%3d,', $value;
    }

    print " ],\n";
}

__END__

Large array values become these subarrays:

    [  1, 11, 12, 13, 14, 15, 16, 17, 18, ],
    [  2, 19, 20, 21, 22, 23, 24, 25, 26, ],
    [  3, 27, 28, 29, 30, 31, 32, 33, 34, ],
    [  4, 35, 36, 37, 38, 39, 40, 41, 42, ],
    [  5, 43, 44, 45, 46, 47, 48, 49, 50, ],
    [  6, 51, 52, 53, 54, 55, 56, 57, 58, ],
    [  7, 59, 60, 61, 62, 63, 64, 65, 66, ],
    [  8, 67, 68, 69, 70, 71, 72, 73, 74, ],
    [  9, 75, 76, 77, 78, 79, 80, 81, 82, ],
    [ 10, 83, 84, 85, 86, 87, 88, 89, 90, ],


    Is that what you really want for each sub array?

Yes, but it start @P = 0 .. 89;

Thanks,

Shiping


HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

Don't tread on my bandwidth. Trim your posts.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to