Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This doesnt seem to work at all as I am unable to get the array value to print out. Eleswhere, the array wont print out when I use print @array either. I can only assume I'm not naming it correctly or something. Any help would be much appreciated$underscore = "_"; for($i = -180; $i < 181; $i = $i+5) { $j = $i+5; if(($x >= -180) && ($x < -175) && ($y >= $i) && ($y < $i+5 )) { $k++; $x1 = "substr($i, 1, 3)"; $x2 = "substr($i, 1, 3)"; $y1 = substr($i, 1, 3); $y2= substr($j, 1, 3); # attempting to name array according to value range $array = "array$underscore$x1$underscore$x2$underscore$y1$unde +rscore$y2"; $count = $count +1; $array[$k] = ($count); print "$array[$k]";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: headache with arrays.
by davido (Cardinal) on Sep 20, 2004 at 15:46 UTC | |
|
Re: headache with arrays.
by Roy Johnson (Monsignor) on Sep 20, 2004 at 16:29 UTC | |
by Anonymous Monk on Sep 20, 2004 at 16:32 UTC | |
|
Re: headache with arrays.
by dragonchild (Archbishop) on Sep 20, 2004 at 15:47 UTC | |
|
Re: headache with arrays.
by Anonymous Monk on Sep 20, 2004 at 16:01 UTC | |
by punkish (Priest) on Sep 20, 2004 at 16:40 UTC | |
by jdporter (Paladin) on Sep 20, 2004 at 20:03 UTC |