#!/usr/bin/perl my $input=$ARGV[0]; open(INFILE,'<:encoding(utf-16LE)',$input) or die("Not able to open the input file $input $!"); while() { my $currentline=$_; next if($currentline=~/^\s+(CLOSE|OPEN)\s+/i); print $currentline; } #### open my $fh, '>:encoding(utf-16LE)', $currentline; open my $fh, '<:encoding(utf-16LE)', $menufile;