#!/usr/bin/perl -w my $start = $ARGV[0]; my $end = $ARGV[1]; while () { print "$1\n" if $_ =~ m{${start}(.*?)${end}}; }