summaryrefslogtreecommitdiff
path: root/bin/hafas-m
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-07-05 15:19:34 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-07-05 15:19:34 +0200
commit220b3bf395fa4aa87a0b5b9c161ac6e59ba08d58 (patch)
tree4cefa5a6a25a12aca4a51f4ab16e934d7a1e043e /bin/hafas-m
parentabf476761e14fbd190a4d06fad5f126dd2943cfc (diff)
Switch to HAFAS::Message class for message handling
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-xbin/hafas-m14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/hafas-m b/bin/hafas-m
index c40f0ab..8eca084 100755
--- a/bin/hafas-m
+++ b/bin/hafas-m
@@ -149,14 +149,14 @@ sub display_result {
my $d = $line->[6];
my $first_message = 1;
for my $msg ( $d->messages ) {
- if ( $msg->{ref_count} == 1 ) {
+ if ( $msg->ref_count == 1 ) {
if ($first_message) {
print "\n";
$first_message = 0;
}
- printf( "# %s\n", $msg->{header} );
- if ( $msg->{lead} ) {
- printf( "# %s\n", $msg->{lead} );
+ printf( "# %s\n", $msg->header );
+ if ( $msg->lead ) {
+ printf( "# %s\n", $msg->lead );
}
}
}
@@ -184,9 +184,9 @@ if ( my $err = $status->errstr ) {
my $message_id = 1;
for my $m ( $status->messages ) {
- if ( $m->{ref_count} > 1 ) {
+ if ( $m->ref_count > 1 ) {
$m->{id} = $message_id++;
- printf( "# (%d) %s\n# %s\n\n", $m->{id}, $m->{header}, $m->{lead} );
+ printf( "# (%d) %s\n# %s\n\n", $m->{id}, $m->header, $m->lead );
}
}
@@ -199,7 +199,7 @@ for my $d ( $status->results ) {
my $info_line = $d->info // q{};
for my $message ( $d->messages ) {
- if ( $message->{ref_count} > 1 ) {
+ if ( $message->ref_count > 1 ) {
$info_line = sprintf( '(%d) %s', $message->{id}, $info_line );
}
}