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

Re: [MacPerl] for loops



On Tue, Dec 29, 1998 at 02:43:55PM +0000, G. Ann Campbell wrote:
} Hi all,
} 
} Does anyone know why, when I use:
} 
}    for ($a=4; $a<8; $a+=1){
}       print INDEX "$txt[$a]\n";
} 
} I get:
} 
}    # Use of uninitialized value.
} 
} returned in the compiler warnings?
} Also, why when I use:
} 
}    for ($i=0; $i<7; $i+=1) {
}       print TXT "$txt[$i]\n\r";
} 
} does it print all the lines of the list to my file, instead of just the first seven?
} 
} Pulling my hair out,
} Ann

How is anyone supposed to help you when you don't show us the most
important part: how are you initializing @txt?  Both of your problems
may be due to how you treat @txt before these loops.  You'd also
better show the opens for INDEX and TXT.


-- 
--------
Paul J. Schinder
schinder@pobox.com


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch