my ($match_1,$match_2) = ($string =~ /(.*):(.*)/) // And in my own scripts I'm using constructs like my ($wanted_service) = (map { /^online.*svc:(.*?):/ } `svcs`)[15];