Current Path : /usr/local/lib/perl5/site_perl/5.8.9/Net/SSH/Perl/Util/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/lib/perl5/site_perl/5.8.9/Net/SSH/Perl/Util/Term.pm |
# $Id: Term.pm,v 1.4 2001/05/24 07:21:28 btrott Exp $ package Net::SSH::Perl::Util::Term; use strict; sub _prompt { my($prompt, $def, $echo) = @_; unless ($echo) { return _read_passphrase($prompt); } else { print $prompt . ($def ? "[$def] " : ""); chomp(my $ans = <STDIN>); return $ans ? $ans : $def; } } sub _read_passphrase { my($prompt) = @_; print $prompt; require Term::ReadKey; Term::ReadKey->import; ReadMode('noecho'); chomp(my $pwd = ReadLine(0)); ReadMode('restore'); print "\n"; $pwd; } sub _read_yes_or_no { my($prompt, $def) = @_; print $prompt, " [$def] "; chomp(my $ans = <STDIN>); $ans = $def unless $ans; $ans =~ /^y/i; } 1;