in reply to printing an array

You just have a small typo in your script, I assume because you copied the first for-loop to produce the second one.. You forgot to change the $eu<=(scalar(@idold)/2-1); to $io<=(scalar(@idold)/2-1);.

In fact, two typos. I assume that <h2>New$idold[$io]/$typeold[$old]</h2> should actually be <h2>New$idold[$io]/$typeold[$io]</h2>, since that is the counter for that for-loop.

Note: using 'use warnings;' at the top of your script would have pointed out that you were using the $old variable only once, and might have led you to the solution. Also, scoping your variables properly (ie my $eu and my $io) would have helped, as it would have died with an Undefined variable error when encountering the $eu the second time around..

C.

Replies are listed 'Best First'.
Re: Re: printing an array
by bory (Beadle) on Mar 30, 2004 at 10:51 UTC
    I did the update, I also put "use warnings" in my code but it's the same problem. Thanks

      As pelagic mentions below, test your data. It looks like what you belive to be in the array actually is in it's first array slot.

      Cheers, Sören