| Subject: | Re: missing values from files |
|---|---|
| From: | isha.renta@xxxxxxxxx (Irenta) |
| Date: | Mon, 30 Jul 2007 17:07:27 -0000 |
| Newsgroups: | perl.beginners |
Thanks it worked! YAY!
On Jul 30, 12:11 pm, chas.ow...@xxxxxxxxx (Chas Owens) wrote:
> On 7/30/07, Isha M. Renta <isha.re...@xxxxxxxxx> wrote:> The 13 is the
> counter for the $inittime array (which actually have 13
> > numbers and not 15 as it seems) and the 3600 is the number of lines in all
> > the files. All the files have 3600 lines.
>
> > Isha
>
> snip
>
> Then you have an off-by-one error. You are saying
>
> for($j=0;$j<=13,$j++) {
>
> This will loop 14 times, not 13 times. This is why C-style for loops
> are bad. Don't use them. If you want to loop over an array use the
> iterating version of for:
>
> for my $element (@array) {}
>
> If you want to loop over a range you still should use the iterating
> version of for:
>
> for my $j (1 .. 13) {}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | ASCII::Plot::Scatter namespace, Inventor |
|---|---|
| Next by Date: | Re: missing values from files, Chas Owens |
| Previous by Thread: | Re: missing values from files, Rob Dixon |
| Next by Thread: | ASCII::Plot::Scatter namespace, Inventor |
| Indexes: | [Date] [Thread] [Top] [All Lists] |