in reply to Re^3: Using qw to check for balanced parentheses
in thread Using qw to check for balanced parentheses

sub is_balanced2 { not    $_[0] =~ tr/)(//    % 2; }

Replies are listed 'Best First'.
Re^5: Using qw to check for balanced parentheses
by Your Mother (Archbishop) on Feb 02, 2011 at 01:29 UTC

    Update: nothing but down votes for this...? This is output from using the above snippet, not suggested results.

    )( is balanced ))))(()((( is balanced
      balance is in the eye of the beholder