#!/usr/bin/perl -w use strict; my $found = 0; while (<>) { if ($found or /RE(.*?)/) { $found = 1; print; } } #### [ar0n@zendo perl]$ perl re.pl < INPUT > OUTPUT