#!/usr/bin/perl -w use strict; my ($start, $end) = qw(banana grape); while () { if (/^$start$/ .. /^$end$/) { print unless /^($start|$end)$/; } } __END__ apple banana pear peach grape orange