$str =~ s/(?<=[a-z])(?=[A-Z])/_/g; say uc $str; [download]
In reply to Re: global match except last one by happy.barney in thread global match except last one by utku