use strict; use warnings; use Lingua::Concordance; my $text = < acoustic guitar in local folk clubs. At this time, he already had two fifteen-minute instrumental pieces in which he would "go through all <2>sorts of moods", precursors to his landmark 1970s' compositions. In his early teens, Oldfield was involved in a 'beat group' <3>playing Shadows-style music (he has often cited Hank Marvin as a major influence, and would later cover The Shadows' song "Wonderful Land"). TEXT my $query = 'in'; my $concordance = Lingua::Concordance->new (); $concordance->radius(25); $concordance->text($text); $concordance->query($query); my @matches = $concordance->lines(); my @pairs; for my $match (@matches) { while ($match =~ /<(\d+)>.*?$query/g) { push @pairs, map {[$_, $match]} $1 if $-[0] < $concordance->radius(); } } print "$_->[0]: $_->[1]\n" for @pairs; #### 1: ng <1> acoustic guitar in local folk clubs. At thi 3: a 'beat group' <3>playing Shadows-style music (he