App-BCVI-NotifyClient
view release on metacpan or search on metacpan
lib/App/BCVI/NotifyClient.pm view on Meta::CPAN
8687888990919293949596979899100101102103104105106
while
(1) {
sleep
(
$opt
->{output});
return
if
$self
->_notify_tty_mtime(
$opt
) !=
$mtime
;
}
}
sub
_notify_tty_mtime {
my
(
$self
,
$opt
) =
@_
;
my
@stat
=
stat
(
$opt
->{tty}) or
die
"stat($opt->{tty}): $!"
;
return
$stat
[9];
}
sub
_notify_current_tty {
my
$tty
=
readlink
(
"/proc/self/fd/0"
);
if
(!
$tty
) {
chomp
(
$tty
= `tty` );
}
die
"Unable to determine TTY\n"
unless
$tty
;
( run in 0.248 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )