in reply to Re^6: Can call array but not index of an array in subroutine?!
in thread Can call array but not index of an array in subroutine?!

Sorry I did'nt really explain what I meant. The values are only acessible by using a negative index system, if I use the following loop, the array appears empty
for ($i=0; $i >= 1000; $i++) { print STDOUT ("$Bxcoord[$i]"); }
But if I use this loop I get the required values from the array.
for ($i=0; $i >= -1000; $i--) { print STDOUT ("$Bxcoord[$i]"); }
many thanks in advance! regards Dan

Replies are listed 'Best First'.
Re^8: Can call array but not index of an array in subroutine?!
by Corion (Patriarch) on Apr 03, 2009 at 14:12 UTC

    Why are you sure that your loop is ever even entered? You got a condition that is wrong at the start of the loop:

    for ($i=0; $i >= 1000; $i++) {

    This is why it is much much better to use foreach to loop over arrays instead of using the C-style loop. Or, if you want to just look at an array, use Data::Dumper or a simple print statement:

    print "@Bxcoord";