[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Loop question



At 4:06 PM 12/5/00, Bruce Van Allen quickly wrote:
>At 12:25 PM 12/5/00, Matthew Fischer wrote:
>>I have a script that reads a file into an array, then prints out each line of

[snip]

>
>   print $whole[0..7];  # <-- should have been @whole[0..7]
>   chomp @whole;
>   foreach $line (@whole) {
>     #do stuff with $line
>   }
>
>Then, just in case you don't want to do _anything_ but print the 
>first 8 lines, but you want to continue and do stuff with the lines 
>after #8, then the foreach loop would be:
>
>   foreach $line (@whole[8..$#whole]) {
>     #do stuff with $line
>   }
>

Sorry for the goof.

1;

- Bruce

__Bruce_Van_Allen___Santa_Cruz_CA__

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org