open ( UPLOADFILE, ">$dir/$file" ) or die "$!"; my $count=0; while ( <$upload_filehandle> ) { @splitted = split (/\t/ , $_); @variable1[$count] = @splitted[1]; ..... }