In the spirit of "match the regex to get the number of parens in it", here's another way:
sub nparens { "" =~ /|$_[0]/ and $#+ }
_____________________________________________________
Jeff
[japhy]Pinyan:
Perl,
regex,
and
perl
hacker, who'd like a
job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;