Date: Thu, 06 Sep 2001 06:16:05 -0400 From: Benjamin Goldberg Subject: Re: can this perl script be more elegant/shorter ? Message-Id: <3B974CE5.BC8FB8E4@earthlink.net> John W. Krahn wrote: [snip] > if ( $chain_number == 7 ) { > for ( my $i = 0; $i < @{ $chain[ $chain_number ] }; $i++ ) { The line with the for loop should probably be: for my $i ( 0 .. $#{ $chain[7] } ) { Since that's smaller, and, if you know what $# means, clearer. Changing $chain_number to 7 in that expression is of course done since it will always be 7, due to the if on the line before it. -- "I think not," said Descartes, and promptly disappeared.