If you have no '{}'s in mid-line comments, you could -
#!/usr/bin/perl -w
use strict;
my ($open, $close) = (0,0);
while( <> ) {
$open += () = $_ =~ m'{'g unless /^#/;;
$close += () = $_ =~ m'}'g unless /^#/;
}
print "Opens: $open\nCloses: $close\n";
# bracket_check.pl < filename
-G
On Tue, 22 Oct 2002 14:17:28 -0400
"Balint, Jess" <[EMAIL PROTECTED]> wrote:
> Hi all. I am sorry to post a question such stupid as this one, but it
> has me stumped. I have a fairly long perl program that gives me the
> following error when I run it.
>
> Missing right bracket at ./a.pl line 877, at end of line
> syntax error at ./a.pl line 877, at EOF
> Execution of ./a.pl aborted due to compilation errors.
>
> I am assuming the bracket is the square bracket (]). 877 is the last
> line of my program and I can't seem to find anywhere that I am missing
> a right bracket. Is there an sure-fire way to figure it out? Thanks.
>
> jess
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]