是否可以 - 在提示輸入密碼時 - 以IO::Prompter配置prompt
,使輸入未添加到歷史記錄中?IO :: Prompter - 是否可以禁用歷史記錄?
#!/usr/local/bin/perl
use warnings;
use strict;
use 5.10.1;
use utf8;
use open qw(:encoding(UTF-8) :std);
use IO::Prompter;
my $password = prompt('Password: ', -echo => '');
say $password;
$password = prompt('Password: ', -echo => '');
say $password;
$password = prompt('Password: ', -echo => '');
say $password;
$password = prompt('Password: ', -echo => '');
say $password;
$password = prompt('Password: ', -echo => '');
say $password;
這裏是refernce一個類似的問題:http://stackoverflow.com/questions/701078/how-can-i-enter-a-password-using-perl-and-replace -the-characters-with – squiguy
如果回顯被禁用,'IO :: Prompter'如何添加到歷史記錄中? –
@mugenkenichi,我加了一個例子 –