while () { $line=; } close INFO; my @new2; if($var{param}) { list_param($var{param}); } if($var{the}) { list_the($var{the}); } #### perl -p -e 's/yourstring/yournewstring/g' inputfile > outputfile