Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: The Grand Cat Dilation Equation

by davido (Cardinal)
on Jan 12, 2014 at 05:27 UTC ( [id://1070322]=note: print w/replies, xml ) Need Help??


in reply to Re: The Grand Cat Dilation Equation
in thread The Grand Cat Dilation Equation

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1070322]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-29 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found