my $string = "first-item \"second item\" third-item"; my @items = split /???/, $string; my $i = 0; print ++$i, ": $_\n" for @items; # Would print: # 1: first-item # 2: "second item" # 3: third-item