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 T
See inline comment:
> -Original Message-
> From: Balint, Jess [mailto:JBalint@;alldata.net]
> Sent: Tuesday, October 22, 2002 2:17 PM
> To: '[EMAIL PROTECTED]'
> Subject: Missing Bracket
>
>
> Hi all. I am sorry to post a question such stupid as this
7;s paired correctly.
/\/\ark
-Original Message-
From: Balint, Jess [mailto:JBalint@;alldata.net]
Sent: Tuesday, October 22, 2002 11:17 AM
To: '[EMAIL PROTECTED]'
Subject: Missing Bracket
Hi all. I am sorry to post a question such stupid as this one, but it h
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