#!/usr/bin/perl while (<>) { # skip initial unwanted lines next if /^<\?xml version/ .. /^<\/Info>/; # process the lines you want... print; }