diff options
| -rwxr-xr-x[-rw-r--r--] | challenge-009/e-choroba/perl5/ch-1.pl | 2 | ||||
| -rw-r--r-- | challenge-057/e-choroba/perl/Tree.pm | 2 | ||||
| -rwxr-xr-x | challenge-060/e-choroba/perl/ch-2.pl | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/challenge-009/e-choroba/perl5/ch-1.pl b/challenge-009/e-choroba/perl5/ch-1.pl index 4a74e71fe3..561873482a 100644..100755 --- a/challenge-009/e-choroba/perl5/ch-1.pl +++ b/challenge-009/e-choroba/perl5/ch-1.pl @@ -6,7 +6,7 @@ use feature qw{ say }; sub distinct_digits { my ($n) = @_; my %d; - undef @d{split //, $n}; + @d{split //, $n} = (); return keys %d } diff --git a/challenge-057/e-choroba/perl/Tree.pm b/challenge-057/e-choroba/perl/Tree.pm index a0a4a8a51f..176c5f574a 100644 --- a/challenge-057/e-choroba/perl/Tree.pm +++ b/challenge-057/e-choroba/perl/Tree.pm @@ -28,7 +28,7 @@ sub from_edges { push @children, $child; } my %root; - undef @root{ keys %tree }; + @root{ keys %tree } = (); delete @root{ @children }; my @roots = keys %root; die "One root not found: @roots." if @roots != 1; diff --git a/challenge-060/e-choroba/perl/ch-2.pl b/challenge-060/e-choroba/perl/ch-2.pl index 0894531600..438c4e5954 100755 --- a/challenge-060/e-choroba/perl/ch-2.pl +++ b/challenge-060/e-choroba/perl/ch-2.pl @@ -5,7 +5,7 @@ use strict; sub extend { my ($length, $short, $long) = @_; my %next; - undef @next{@$short}; + @next{@$short} = (); for my $i (0 .. $#$short) { for my $j (0 .. $#$short) { my $new = 0 + ($short->[$i] . $short->[$j]); @@ -25,7 +25,7 @@ sub extend { sub find { my ($length, $greater, @list) = @_; my @long = grep $length == length $_, @list; - my %long; undef @long{@long} if @long; + my %long; @long{@long} = (); return grep $greater > $_, extend($length, \@list, \%long); } |
