From d068eab8be3750ddf64ba2fa09918402821073a4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 7 Jul 2011 12:11:10 +0200 Subject: DeutscheBahn.pm: Strip leading/trailing whitespace in result fields --- Changelog | 5 +++++ lib/Travel/Status/DE/DeutscheBahn.pm | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index a09ed3b..616ac49 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,8 @@ +git HEAD + + [Travel::Status::DE::DeutscheBahn] + * Strip leading / trailing whitespace in result fields + Travel::Status::DE::DeutscheBahn 0.02 - Wed Jul 06 2011 [db-ris] diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm index bd22103..ea869d0 100644 --- a/lib/Travel/Status/DE/DeutscheBahn.pm +++ b/lib/Travel/Status/DE/DeutscheBahn.pm @@ -62,7 +62,7 @@ sub new { confess("Could not submit POST request: ${errstr}"); } - $ref->{html} = $reply->content(); + $ref->{html} = $reply->content; $ref->{tree} = XML::LibXML->load_html( string => $ref->{html}, @@ -138,6 +138,8 @@ sub results { for my $str ( $time, $train, $dest, $platform, $info ) { $str =~ s/\n/ /mg; $str =~ tr/ //s; + $str =~ s/^ +//; + $str =~ s/ +$//; } $info =~ s{ ,Grund }{}ox; -- cgit v1.2.3