summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-07-07 12:11:10 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-07-07 12:11:10 +0200
commitd068eab8be3750ddf64ba2fa09918402821073a4 (patch)
treed1a54d8b63ae6b40d6f02f4ec59349553f4fc344 /lib/Travel
parent1bf2ad57fdc64aa78685af6ebc568af1a41bfeb3 (diff)
DeutscheBahn.pm: Strip leading/trailing whitespace in result fields
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn.pm4
1 files changed, 3 insertions, 1 deletions
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;