Based on the code that you posted, there is no way you could have gotten that warning (unless it is a bug in the version of Perl you are using.) $new is assigned the value $temp[0].'.'.$temp
so it will never contain the value undef. $temp1[0] is assigned from split(/\s+/,$line1) and $line1 is assigned from a file and the only way that $temp1[0] could contain undef is if $line1 contained '' and it is not possible to have a line like that in a file.