my $input_xml = $client->responseContent(); instead of my $input_xml = do { local $/; }; which breaks at push @data,[ map { $record->first_child($_)->text } @cols]; Because of the $_