aboutsummaryrefslogtreecommitdiffstats
path: root/makepass.pl
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-09-04 06:40:32 +0200
committerDennis Eriksen <d@ennis.no>2023-09-04 06:40:32 +0200
commit79a22652f030a8b5b85072a765ab66c55f01c695 (patch)
treea2b4fbc776855dac1ec31faedf393fad5c3ca9fd /makepass.pl
parentadding readme (diff)
downloadmakepass-79a22652f030a8b5b85072a765ab66c55f01c695.tar.gz
improving readability a tiny bit
Diffstat (limited to 'makepass.pl')
-rwxr-xr-xmakepass.pl6
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] );
}