From d1fc0bb1954d468e1c07245fe5af2b16799f7f38 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 28 Aug 2024 01:04:18 +0200 Subject: use modern Perl, and use signatures --- bin/events2md.pl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bin/events2md.pl b/bin/events2md.pl index 12fe7a3..725e8f5 100755 --- a/bin/events2md.pl +++ b/bin/events2md.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl -use v5.14; +use v5.36; +use strict; use utf8; use open qw(:std :encoding(UTF-8)); -use strictures; use autodie; use Feature::Compat::Try; @@ -188,16 +188,13 @@ else { print $content; } -sub resolve_event +sub resolve_event ( $entry, $start, $end = undef ) { - my ( $entry, $start, $end, $path ) = @_; - if ( $log->is_trace ) { use DDP; p $entry; p $start; p $end; - p $path; } my $summary = get_property_string( $entry, 'summary' ); my $description = get_property_string( $entry, 'description' ); @@ -255,10 +252,8 @@ sub resolve_event }; } -sub get_property_string +sub get_property_string ( $entry, $key ) { - my ( $entry, $key ) = @_; - return '' unless $entry->property($key); -- cgit v1.2.3