input
*************
Code:
/home/user> cat inputfile
Abcd
2222
ERROR:duplicate
ERROR:Getinstrument
ERROR:duplicate
www
xxx
/home/user>
program
*************
Code:
/home/user> cat > prog
open(FH,"inputfile");
open(FH1,">","outputfile");

while(<FH>)
{
 if ( $_ =~ m/ERROR/)
...