#!/usr/bin/perl -w use strict; my $file="file"; open FILE, $file or die $!; while () { if (m{"*end*of*junk*data*".*?}i .. m{"*start*of*junk*data*".*?}) { print; } } close (FILE);