$s = "firstfield second field KNOWNWORD alwaysOneWord then one or more make the last field";; @fields = $s =~ m[(\S+)\s(.+)\sKNOWNWORD\s(\S+)\s(.+)];; print join '|', @fields;; firstfield|second field|alwaysOneWord|then one or more make the last field