RE: MySQL in a for loop
- From: cclarkson@xxxxxxxxxx (Charles K. Clarkson)
- Date: Wed, 27 Jul 2005 19:33:29 -0500
David Van Ginneken <mailto:davevg@xxxxxxxxx> wrote:
: : #Get and process mail
: : for my $messageID (90){
: What exactly is this supposed to do? If you just run this
: for my $messageID (90){
: print $messageID . "\n";
: }
: It outputs nothing..
Actually, it outputs "90\n". There is no reason why
the list in a 'for' loop cannot iterate over just one item.
In fact, it can make testing easier by allowing us to
substitute a list with just one test item.
foreach my $item ( @very_large_array ) {
print "$item\n";
}
Can be replaced with this for testing:
foreach my $item ( $single_test_item ) {
print "$item\n";
}
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
.
- Follow-Ups:
- Re: MySQL in a for loop
- From: David Van Ginneken
- Re: MySQL in a for loop
- References:
- Re: MySQL in a for loop
- From: David Van Ginneken
- Re: MySQL in a for loop
- Prev by Date: Re: Help: automated email forwarding similar to .forward
- Next by Date: Re: login shell?
- Previous by thread: Re: MySQL in a for loop
- Next by thread: Re: MySQL in a for loop
- Index(es):