From 53cf789f02f754f10650ce94e2b01997dda61a4d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 18 Jul 2011 17:34:17 +0200 Subject: DeutscheBahn.pm: Make ->results work properly when used multiple times --- lib/Travel/Status/DE/DeutscheBahn.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm index 46c3928..baf1fe2 100644 --- a/lib/Travel/Status/DE/DeutscheBahn.pm +++ b/lib/Travel/Status/DE/DeutscheBahn.pm @@ -113,6 +113,10 @@ sub results { \d{1,2}:\d{1,2} }mx; + if ( defined $self->{results} ) { + return @{ $self->{results} }; + } + for my $tr ( @{ $self->{tree}->findnodes($xp_element) } ) { my ($n_time) = $tr->findnodes($xp_time); -- cgit v1.2.3