http://www.perlmonks.org?node_id=1079022
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to use strict perl coding for this simple task, but my variable returns empty. Why?
use strict; my $final_res=''; open FILE, $infile; while(my $final_line=<FILE>) { if($final_line=~/^SeqID/) { my $final_line=<FILE>; chomp $final_line; my @split_final=split(/\t/, $final_line); my $final_res = $split_final[7]; $final_res=~s/D/M/g; $final_res=~s/U/M/g; #print $final_res."\n"; } } close FILE; print $final_res."\n";

If I print inside the loop, in the comment, it prints fine. what am I missing?