-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
64 lines (47 loc) · 2.13 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
NAME
Term::ReadPassword::Win32 - Asking the user for a password (for Win32)
SYNOPSIS
use Term::ReadPassword::Win32;
while (1) {
my $password = read_password('password: ');
redo unless defined $password;
if ($password eq 'flubber') {
print "Access granted.\n";
last;
} else {
print "Access denied.\n";
redo;
}
}
DESCRIPTION
This module lets you ask the user for a password from the keyboard just
as Term::ReadPassword.
Using Term::ReadPassword is a good way to make password prompts, but it
doesn't work with ActivePerl under Windows. So I wrote this module.
You can use this module under Windows or Unix. If you use this under
Windows, Win32::* modules are required. If you use this under Unix, this
acts as a wrapper to Term::ReadPassword.
The Term::ReadPassword::Win32::read_password function is almost same as
Term::ReadPassword::read_password function.
The first and second parameters are just same. The first one is a prompt
message, and the second one is timeout value.
The third parameter is different from Term::ReadPassword::read_password.
If the third parameter is 0, Ctrl+C will be entered into the input
buffer just as any other character.
If the third parameter is 1, the input operation is terminated when the
user types Ctrl+C or Esc.
If the third parameter is 2, the input operation is terminated when the
user types Esc. If the user types Ctrl+C, the program may be terminated.
If the user types Ctrl+U, the input buffer will be cleared.
BUG
Multibyte characters are not treated properly. (When you want to delete
a multibyte character, you must type BackSpace more than once.)
SEE ALSO
Term::ReadPassword, Term::Getch
COPYRIGHT
Copyright (C) 2005 Ken Takata <kentkt@anet.ne.jp>
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
DOWNLOAD
You can download the latest version from http://webs.to/ken/ (Japanese
page)