in reply to String Matching

I was thinking maybe something along these lines...
if($line2 =~ /[HAVE\s(.*)]/){ my @array = split(/,/, $2); foreach my $num(@array){ print $num."\n"; } }
Not sure if this is the best way....