diff options
| -rwxr-xr-x | challenge-125/wlmb/perl/ch-1.pl | 4 | ||||
| -rwxr-xr-x | challenge-125/wlmb/perl/ch-2.pl | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/challenge-125/wlmb/perl/ch-1.pl b/challenge-125/wlmb/perl/ch-1.pl index 013c275aff..24b829e36d 100755 --- a/challenge-125/wlmb/perl/ch-1.pl +++ b/challenge-125/wlmb/perl/ch-1.pl @@ -23,8 +23,8 @@ foreach(@ARGV){ } } say "Input; $_\nOutput:"; - say "\t$_" foreach uniq map { - my($A,$B,$K)=@$_; + say "\t$_" foreach uniq map { #remove duplicates + my($A,$B,$K)=@$_; # careful not to confuse with $a and $b from sort my ($x, $y, $z)=sort {$a <=> $b} map {$K*$_} ($A**2-$B**2, 2*$A*$B, $A**2+$B**2); "\t($x, $y, $z)"; } @found; diff --git a/challenge-125/wlmb/perl/ch-2.pl b/challenge-125/wlmb/perl/ch-2.pl index 0038bf556b..bf1435526e 100755 --- a/challenge-125/wlmb/perl/ch-2.pl +++ b/challenge-125/wlmb/perl/ch-2.pl @@ -11,7 +11,7 @@ use List::Util qw(max); foreach(@ARGV){ die("Only []0-9, and spaces allowed") unless m/^([][0-9,\s])*$/; my $tree_as_array=eval $_; - warn("eval failed @!"), next if @!; + warn("eval failed $@"), next if $@; my $tree_as_hash=make_tree($tree_as_array); my @path=(reverse(path($tree_as_hash->{head}{left})), $tree_as_hash->{head}{value}, path($tree_as_hash->{head}{right})); |
