diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-26 20:01:11 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-26 20:05:08 +0200 |
commit | b7c29656a2b8fc4f22695c30057c2ad888dab7f9 (patch) | |
tree | b84519fb4c8aa5a1616f4b48f27d02679e3d0e03 /lib | |
parent | c200438b71ec3240b56d181a9ceee03b89685976 (diff) |
VRR.pm: Convert all remaining functions to methods
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Net/Travel/DE/VRR.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Net/Travel/DE/VRR.pm b/lib/Net/Travel/DE/VRR.pm index fd3edc4..57b5f66 100644 --- a/lib/Net/Travel/DE/VRR.pm +++ b/lib/Net/Travel/DE/VRR.pm @@ -276,7 +276,10 @@ sub create_post { } sub parse_initial { - my ($tree) = @_; + my ($self) = @_; + + my $tree = $self->{tree} + = XML::LibXML->load_html( string => $self->{html_reply}, ); my $con_part = 0; my $con_no; @@ -323,7 +326,7 @@ sub parse_initial { } sub parse_pretty { - my ($con_parts) = @_; + my ( $self, $con_parts ) = @_; my @elements; my @next_extra; @@ -421,14 +424,11 @@ sub submit { sub parse { my ($self) = @_; - my $tree = XML::LibXML->load_html( string => $self->{html_reply}, ); - - my $raw_cons = parse_initial($tree); + my $raw_cons = $self->parse_initial(); for my $raw_con ( @{$raw_cons} ) { - push( @{ $self->{routes} }, parse_pretty($raw_con) ); + push( @{ $self->{routes} }, $self->parse_pretty($raw_con) ); } - $self->{tree} = $tree; $self->check_ambiguous(); $self->check_no_connections(); |