From f725c79e44f09cff5727b63ebe25637a96fd5a13 Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Fri, 3 Mar 2017 12:49:27 +0100 Subject: [PATCH] pos2gpx,pos2kml: stdin-update --- rs92/pos2gpx.pl | 7 ++++++- rs92/pos2kml.pl | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/rs92/pos2gpx.pl b/rs92/pos2gpx.pl index 7e9ceb3..261867a 100755 --- a/rs92/pos2gpx.pl +++ b/rs92/pos2gpx.pl @@ -4,7 +4,12 @@ use warnings; my $filename = $ARGV[0]; my $fh; -open($fh, $filename) or die "Could not open $filename: $!"; +if (defined $filename) { + open($fh, "<", $filename) or die "Could not open $filename: $!"; +} +else { + $fh = *STDIN; +} print "\n"; print "\n"; diff --git a/rs92/pos2kml.pl b/rs92/pos2kml.pl index 4bff6ef..b5af74f 100755 --- a/rs92/pos2kml.pl +++ b/rs92/pos2kml.pl @@ -4,7 +4,12 @@ use warnings; my $filename = $ARGV[0]; my $fh; -open($fh, $filename) or die "Could not open $filename: $!"; +if (defined $filename) { + open($fh, "<", $filename) or die "Could not open $filename: $!"; +} +else { + $fh = *STDIN; +} print "\n"; print "\n";