Help with system command

Hi,
I have a file 'acct_07756734.dat' and need to do some grep operation from a script
grep 'usage' acct_07756734.dat|wc -l
8
I need to do the same operation in aperl script,its is like
system(grep 'usage' acct_07756734.dat|wc -l);
in this case I wont be getting the value '8',instead success or failure return value of system command.
can any one suggest me how to perform this?
:confused:

Use code tags , post example of input and required output.
It makes it more easy to help.

Eg:my input file is like :
/tmp/fix more test
XMLReader 20398 RESTART Feb_08
XMLReader 20399 RESTART Feb_08
XMLReader 20400 RESTART Feb_08
XMLReader 20401 RESTART Feb_08
XMLReader 20952 RESTART Feb_08
XMLReader 20951 RESTART Feb_08
XMLReader 20404 RESTART Feb_08
XMLReader 20950 RESTART Feb_08

/tmp/fix grep RESTART test|wc -l
/tmp/fix 7

my code is like:

sub process
{
 my $output = system("grep RESTART test|wc -l");
 print "output is $output \n";
}

Here the output is displayed as '0' but I expected the output as '7'.

output=$(grep RESTART test|wc -l)
echo "output is $output"
output is 8

I do get 8 for this code. I guess you did count one wrong.

awk '/RESTART/ {c++} END {print "output is",c}' test
output is 8

check out this link

Try something like this

perl -le '$x = `grep RESTART test | wc -l` ; print "output is = $x"'