#!/usr/bin/perl -T use strict; use warnings; use utf8; use open qw(:std :utf8); use Encode qw(encode decode); use Net::Domain qw(hostname); @ARGV = map { decode("UTF-8", $_) } @ARGV; my %el_hash; my $elev; my $hostname = hostname(); if ( "$hostname" eq "doomy" ) { while (<>) { chomp; my ($x, $y, $a, $alt, $b) = split; $el_hash{$alt}++ if ($alt > 0 && $alt < 200); } } if ( "$hostname" eq "crater" ) { while (<>) { chomp; my ($x, $alt, $y) = split; $el_hash{sprintf("%.1f", $alt)}++ if ($alt > 0 && $alt < 200); } } foreach $elev (sort {$a <=> $b} keys %el_hash) { printf "%.1f m\t%d\n", $elev, $el_hash{$elev}; }