in reply to Subphrases from a phrase

I'm making the assumption that your definition of "phrase" requires that the words be contiguous in the original text. That would explain the missing "Camel Book" phrase. What I came up with is no shorter, but it works.
#!/usr/bin/perl use strict; use warnings; my @words = qw(Camel Perl Book); for my $phrase_length (1..@words) { for my $start_idx (0..(@words-$phrase_length)) { print "@words[$start_idx .. ($start_idx + ($phrase_length - 1))]\n +"; } }