$fcount=()=$data=~m/YOUR REGEX HERE/xig #### @matches=$data=~m/YOUR REGEX HERE/xig; $fcount = @matches;