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";