use warnings; use strict; use Data::Dump qw(dd); my $data = do { local $/; }; my @strings = $data =~ /\"[^\"]+\"/g; dd \@strings; __DATA__ nothing "hello" foo "bar" quz "hello2" "world" foo2 "bar2" quz2 "baz" blah blah2 "" blah3 many lines of unquoted stuff "example 1 for instance"