language: Perl (perl 5.16.2)
date: 1004 days 15 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package Password;
use strict;
use warnings;
 
# every time the user guesses the password wrong, its value
# is rotated by one character
my $password;
sub set_password {
    $password = shift;
}
sub check_password {
    my $guess = shift;
    if ($guess eq $password) {
        unlock_secrets();
    } else {
        $password = (substr $password, 1).(substr $password, 0, 1); 
    }   
}
1;