From 79a22652f030a8b5b85072a765ab66c55f01c695 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 4 Sep 2023 06:40:32 +0200 Subject: improving readability a tiny bit --- makepass.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'makepass.pl') 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 = ) 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] ); } -- cgit v1.2.3