App-wmiirc
view release on metacpan or search on metacpan
lib/App/wmiirc/Ssh.pm view on Meta::CPAN
7891011121314151617181920212223242526sub
action_ssh {
my
(
$self
,
@args
) =
@_
;
state(
$last_mtime
,
@hosts
);
my
$known_hosts
=
"$ENV{HOME}/.ssh/known_hosts"
;
if
(-r
$known_hosts
&& !
$last_mtime
||
$last_mtime
!=
stat
(
$known_hosts
)->mtime) {
open
my
$fh
,
"<"
,
$known_hosts
or
die
"$known_hosts: $!"
;
@hosts
=
map
/^([^, ]+)/ ? $1 : (), <
$fh
>;
}
if
(
my
$host
=
@args
?
"@args"
: wimenu {
name
=>
"host:"
,
history
=>
"ssh"
}, \
@hosts
) {
system
$self
->core->main_config->{terminal} .
" -e ssh $host &"
;
}
}
( run in 0.224 second using v1.01-cache-2.11-cpan-05444aca049 )