eval { $photoid = $ua->upload( 'photo' => $processing_folder_image_list_paths[$i], 'auth_token' => $auth_token, 'is_public' => 1, 'is_friend' => 1, 'is_family' => 1, 'async' => 0, ); } or $@ = "timeout by uploading $processing_folder_image_list_paths[$i]"; if ($@ eq '') { $photoid_error = 0; } else { $photoid_error = 1; push(@error_list, $@)};