c:\@Work\Perl>perl -le "use Data::Dump qw(dd); ;; $password = 'perlclass'; print qq{What is the password to access the system\n}; $count = 0; @wrongPasswords[4] = (); dd \@wrongPasswords; ;; while($guess ne $password && $count != 4 ){ $guess = ; chomp($guess); if($guess eq $password){ print qq{You have unlocked the program\n}; } else { push(@wrongPasswords,$guess); if($count != 3){ print qq{Sorry wrong choice! Try again\n}; } else{ print qq{\nYou have enter too many passwords!\nProgram Locked!!\n}; print qq{Here are the passwords that were entered\n}; dd \@wrongPasswords; ;; print qq{@wrongPasswords\n}; } } $count++; }; print 'pause...'; " What is the password to access the system [undef, undef, undef, undef, undef] foo Sorry wrong choice! Try again bar Sorry wrong choice! Try again baz Sorry wrong choice! Try again boff You have enter too many passwords! Program Locked!! Here are the passwords that were entered [undef, undef, undef, undef, undef, "foo", "bar", "baz", "boff"] foo bar baz boff pause...