open(TMPL, '<', "HTML.txt") or die $!; %dump = $resp->content; print TMPL %dump; while () { $dump{$_} = $_; } close(TMPL); open FILE, "> new_HTML.txt" or die $!; open FILE2, "< Users.txt" or die $!; while() { if(defined($sp_dump{$_})) { print FILE $sp_dump{$_}; } else { print"Line not match"; } } close(FILE2); close(FILE);