? It may be slower, but detects ')(' as incorrectsub balanced { (my $s = shift) =~ s/[^()]//g; while ( $s =~s /\(\)// ){}; return $s ? 0 : 1; }
In reply to Re^2: Using qw to check for balanced parentheses
by Anonymous Monk
in thread Using qw to check for balanced parentheses
by unix_hacker_beard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |