use strict; my $countline = 0; my $mytest; my @array = (); #<- added line open (MYFILE,"<testing.txt")||die "Could not open input file\n"; while($mytest = <MYFILE>) { my @datas= split (/\s+/, $mytest); if ($datas[0] eq "Hello") { $countline++; $array[$countline] = $countline; #<- added line } my @test1 = $countline; print $test1[0]; }
In reply to Re: help with an array
by kwaping
in thread help with an array
by cravena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |