in reply to The Grand Cat Dilation Equation

Larry Wall: 7 cats
Perl: 2 cats
C: 5 cats
Java: 0 cats
Assembly: 8 cats

Replies are listed 'Best First'.
Re^2: The Grand Cat Dilation Equation
by davido (Cardinal) on Jan 12, 2014 at 05:27 UTC

    Perl has at least seven eight cats without leaving the core or shelling out. And I'm sure I'm missing more than I identified.

    $new = $string_a . $string_b; # 1 cat. $new = join '', $string_a, $string_b; # 2 cats. $new = "$string_a$string_b"; # 3 cats. $new = pack '(A*)*', $string_a, $string_b; # 4 cats. $new .= $_ for $string_a, $string_b; # 5 cats. $new = do { open my $fh, '>', \my $var; print {$fh} $string_a, $string_b; close $fh; $var; }; # 6 cats. $new = List::Util::reduce { $a .= $b } $string_a, $string_b; # 7 cats. $new = sprintf '%s%s', $string_a, $string_b; # 8 cats.

    Dave