Hi Monks,
I'm having trouble with the following code. I'm using __DATA__ for this, but originally ran into the problem with an external file. Basically, the act of reading from a handle seems to be nuking the content of my array of arrays, and I get a "use of uninitialized value..." once I've hit __DATA__.
Here's the code:
use strict; use warnings; my @testarray; push @testarray, [10,20],[30,40]; print "ok...\n"; print "$#testarray\n"; print "$testarray[0]->[0]\n\n"; foreach(@testarray){ while(<DATA>){ } } print "Nope...\n"; print "$#testarray\n"; print "$testarray[0]->[0]\n"; __DATA__ hello world
And here's the output:
ok... 1 10 Nope... 1 Use of uninitialized value in concatenation (.) or string at test_02.p +l line 17, <DATA> line 2.
Tom Melly, pm (at) cursingmaggot (stop) co (stop) ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
In reply to Arrays and Handles Problem by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |