sub is_balanced { my $string = shift; eval("qw($string)"); return 0 if $@; return 1; }