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" #### c:\@Work\Perl\monks\kepler>perl extract_double_quote_bodies_2.pl [ "\"hello\"", "\"bar\"", "\"hello2\"", "\"world\"", "\"bar2\"", "\"baz\"", "\" blah3\nmany\nlines\nof\nunquoted stuff\n\"", ]