perl script help

I am new to perl and trying to write script which will check the indentation/formatting/case etc for oracle/ PL-SQL scripts. For this purpose, I am writing a script that reads the PL-SQL script line by line. As follows:

open(DATAFILE, "< sample_spec.pks");
$linecount=0;
while ($line = <DATAFILE>)
{
chomp($line);
if ($rawdatas !~ /--/)
{
check_some_operaion;
}
$linecount++;
}

But the per script should work in such a way that it will do the check_some_operation ONLY for uncommented lines.

This is working fine for the comments which has been given using '--' as comment line. However I am not being able to filter the comment part which has been given using /* */ for several lines as follows :

/* some comment
some more comment
some more comment */

Note that the linecount variable should return the exact value of total number of lines including comment part.

Please can you advise?

This is not very robust, but should be along the lines of what you are doing.

#!/usr/bin/perl -w

use v5.8.0;

my $test = <<EOF;
-- This is comment
A
/* Hello
   This should be ignored
   and also this line */
B
C
D
EOF

my $linecount = 0;
my $ignoreLine = 0;
open(FILE, '<', \$test);
while ($line = <FILE>) {
	$linecount++;
	next if ($line =~ /^--/);
	if ($line =~ /^\/\*/) {
		$ignoreLine = 1;
		next;
	} elsif ($line =~ /\*\//) {
		$ignoreLine = 0;
		next;
	}
	next if ($ignoreLine);
	print $line;
}
close(FILE);

print "Lines = $linecount\n";