Where does @current_list and @temp_list come from? They seem to be global variables declared elsewhere in your script. To see what they actually contain use Data::Dumper to print them out, and do the same for @current_devicelist and @temp_devicelist. Insert this code and come back with the results - and don't forget to use code tags:
use Data::Dumper;
test_updatedevice();
sub test_updatedevice {
print Dumper(\@current_list);
print Dumper(\@temp_list);
my $Device_LINK =
$server->object("ICF_PersistentDataSet",$devicelinks);
my $Temp_Device_LINK =
$server->object("ICF_PersistentDataSet",$tempdevicelinks);
my $current_devicelist = $Device_LINK->invoke("get");
my $temp_devicelist = $Temp_Device_LINK->invoke("get");
print Dumper($current_devicelist);
print Dumper($temp_devicelist);
}