Re: Question abount counting the total number of lines and put to an variable?
- From: marco@xxxxxxxxxxxx (Marco)
- Date: Thu, 29 Nov 2007 18:10:04 -0800 (PST)
Here blow is the code I did..
open (MYFILE, '123.txt');
while (<MYFILE>) {
if ($_ =~ /^User:/){
$count = $_+1;
print "$count\n";
}
}
close (MYFILE);
But it shows the result below,
1
1
1
How can I add those together become 3 ?
.
- References:
- Prev by Date: Re: Question abount counting the total number of lines and put to an variable?
- Next by Date: Re: Question abount counting the total number of lines and put to an variable?
- Previous by thread: Re: Question abount counting the total number of lines and put to an variable?
- Next by thread: Re: Question abount counting the total number of lines and put to an variable?
- Index(es):