in reply to Re: Using qw to check for balanced parentheses
in thread Using qw to check for balanced parentheses
? It may be slower, but detects ')(' as incorrectsub balanced { (my $s = shift) =~ s/[^()]//g; while ( $s =~s /\(\)// ){}; return $s ? 0 : 1; }
|
|---|