#!/usr/bin/env perl use strict; use warnings; use 5.010; use IO::Handle; use IPC::Run qw(harness io); use SDL::Mixer; use SDL::Music; use Term::Size; use Time::HiRes qw(usleep); our $VERSION = '0.0'; my $host = shift; my $id = 0; my $rtt = 0; my $last_id = 0; my $beep; my $was_beep = 1; my $dead_count = 0; my $column = 0; my $column_max = Term::Size::chars; my $mixer = SDL::Mixer->new(); my $beep_sound = SDL::Music->new('beep.ogg'); my $ping = harness( [ 'ping', '-n', $host ], '<' => \undef, '>&' => \&parse_ping_output, ); local $SIG{TERM} = \&quit; local $SIG{INT} = \&quit; sub parse_ping_output { my ($line) = @_; chomp($line); if ( $line =~ m{ ^ \d+ \s bytes \s from \s \S+ \s icmp_req = (? \d+ ) \s ttl = (? \d+ ) \s time = (?