We don't bite newbies here... much PerlMonks

### The Grand Cat Dilation Equation

 on Jan 11, 2014 at 15:34 UTC ( #1070270=CUFP: print w/replies, xml ) Need Help??

The basic theory behind this is the more you age the more cats you acquire. I'm asserting that you don't get your first cat until you are at least 19.

```print "age: ";
my \$age = <STDIN>;
chomp \$age;

print int(( (\$age - 12) / 10 ) / 0.618), " cats";

Replies are listed 'Best First'.
Re: The Grand Cat Dilation Equation
by AnomalousMonk (Chancellor) on Jan 11, 2014 at 15:40 UTC

You don't acquire cats. Cats acquire you.

Re: The Grand Cat Dilation Equation
by hdb (Monsignor) on Jan 11, 2014 at 17:55 UTC
Re: The Grand Cat Dilation Equation
by perlaintdead (Scribe) on Jan 11, 2014 at 17:54 UTC
Larry Wall: 7 cats
Perl: 2 cats
C: 5 cats
Java: 0 cats
Assembly: 8 cats

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

Re: The Grand Cat Dilation Equation
by Anonymous Monk on Jan 16, 2014 at 19:00 UTC
Dogs have owners. Cats have staff.

Create A New User
Node Status?
node history
Node Type: CUFP [id://1070270]
Approved by Corion
Front-paged by Arunbear
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2018-03-19 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (231 votes). Check out past polls.

Notices?