#!usr/bin/perl use warnings; use strict; my @text; while ( <> ) { push @text, grep /important/, $_; } print @text, "\n"; print @ARGV, "\n";