in reply to using split
perl -e 'my $blah = "reagen OR siedl OR smith AND jack"; @names = spli +t /\s+( AND|OR)\s+/, $blah; @split_values = $blah =~ /\s+(AND|OR)\s+/g' [download]