PERL:

              

PERL: - . 510


Template Entry Demonstration

Address Data Example Record #

Name: [______________________________________ ]

Add r: [______________________________________ ]

City: [__________ ] State: [__] Zip: [\\\\\]

Phone: (\\\) \\\-\\\\ Password: [. ]

Enter all information available.

Edit fields with left/right arrow heys or "delete".

Switch fields with "Tab" or up/down arrow keys.

Indicate completion by pressing "Return".

Refresh screen with "Control-L".

Abort this demo here with "Control-X".

. ­ , \, - ~. Perl, , , .

> ------------------------------------------------------------------------

Man- curses(3) ( ); Curses perlmenu CPAN; Formatsperlform(l); 3.10.

15.13. Expect

­, , STDIN STDOUT.

Expect CPAN:

use Expect;

Scommand = Expect->spawn("program to run") or die "Couldn't start program: $!\n";

#  STDOUT
$command->log_stdout(0);

#  10 "Password:"
unless ($command->expect(10, "Password")) {

# -


15.13. Expect 541

# 20 , /[ll_]ogin: ?/ unless ($command->expect(20, -re => '[lL]ogin: ?')) { #

# "invalid" unless ($command->expect(undef, "invalid")) <