#!/usr/bin/perl
use strict;
use warnings;
my $str = "abc(def)ghi";
my $regexp = qr/( \( [^()]* \) )/x;
my @strArr = grep {/\S/} split /$regexp/, $str;
IyEvdXNyL2Jpbi9wZXJsCgp1c2Ugc3RyaWN0Owp1c2Ugd2FybmluZ3M7CgoKbXkgJHN0ciA9ICJhYmMoZGVmKWdoaSI7Cm15ICRyZWdleHAgPSBxci8oIFwoIFteKCldKiBcKSApL3g7Cm15IEBzdHJBcnIgPSBncmVwIHsvXFMvfSBzcGxpdCAvJHJlZ2V4cC8sICRzdHI7CnByaW50IGpvaW4oIiwgIiwgQHN0ckFycik7