aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-102/james-smith/perl/ch-2.pl6
1 files changed, 2 insertions, 4 deletions
diff --git a/challenge-102/james-smith/perl/ch-2.pl b/challenge-102/james-smith/perl/ch-2.pl
index fb4aefd33f..9c56218640 100644
--- a/challenge-102/james-smith/perl/ch-2.pl
+++ b/challenge-102/james-smith/perl/ch-2.pl
@@ -44,10 +44,8 @@ done_testing();
## If you have a single gap just prefix by "#"
sub hash_count_string {
- my ( $s, $n ) = ( '', @_ );
-
- ( $s, $n ) = ( $n.'#'.$s, $n-1-length $n ) while $n > 1;
-
+ my ( $s, $n ) = ( '', @_ );
+ ( $s, $n ) = ( "$n#$s", $n-1-length$n ) while $n > 1;
return '#'x$n.$s;
}