| 1 | |||||||||||||
| 2 | #!/usr/bin/perl | ||||||||||||
| 3 | |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 1 | ▶ | use Term::ReadLine; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | my $term = Term::ReadLine->new('Simple password checker'); | |||||||||||
| 9 | 1 | my $prompt = 'Please enter your password:'; | |||||||||||
| 10 | 1 | ▶ | my $OUT = $term->OUT || \*STDOUT; | ||||||||||
|
Condition50%1/2
$term->OUT || \*STDOUT
MC/DC0%0/1
$term->OUT || \*STDOUT
$term->OUT
Truth table50%1/2
A
A= $term->OUT
| |||||||||||||
| 11 | 1 | my $result = $term->readline($prompt); | |||||||||||
| 12 | 1 | ▶ | if($result eq 'secret') | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 13 | { | ||||||||||||
| 14 | 1 | print "Password accepted.\n"; | |||||||||||
| 15 | } | ||||||||||||
| 16 | else | ||||||||||||
| 17 | { | ||||||||||||
| 18 | 0 | print "Password not accepted.\n"; | |||||||||||
| 19 | } | ||||||||||||