diff options
Diffstat (limited to 'makepass.pl')
-rwxr-xr-x | makepass.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/makepass.pl b/makepass.pl index defe5fc..9cc3569 100755 --- a/makepass.pl +++ b/makepass.pl @@ -101,7 +101,8 @@ sub randstring (@chars) { sub print_columns ( $title, $num, @chars ) { say "$title:"; - my @strings = map { randstring(@chars) } 1 .. $num; + my @strings; + push( @strings, randstring(@chars) ) foreach ( 1 .. $num ); # Calculate the number of columns that can fit on the screen. my $length = @@ -134,7 +135,8 @@ chomp( my @wordlist = <FILE> ) and close(FILE); # Return passphrases # sub passphrase ($arrh) { # Use array-handle to avoid copying large array around - my @indexes = map { rand( @{$arrh} ) } 1 .. PASS_NUM; + my @indexes; + push( @indexes, rand( @{$arrh} ) ) foreach ( 1 .. PASS_NUM ); join( '-', @{$arrh}[@indexes] ); } |