while () { @line=; #will this help ? my @new2; if($var{param}) { list_param($var{param}); } if($var{the}) { list_the($var{the}); } sub list_param($) { if ($line =~ m:Absolute_Error_Tolerance=":) { $line=$line1; @new2=split(/\"/,$line1); $line1=~s/$new2[1]/$G{param}/; } }