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 ?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to