use Text::Balanced qw/ :ALL /; my @parts = extract_multiple( $line, [ sub { extract_delimited( $_[0], '"', ); }, ], ); dd\@parts;