The 2 on the third line should not have a space after it.
=) Nasty with all those evals.
You sould shorten it a bit with $_= at the beginning,
and then change @i=split(/\s/,$d); to
split/\s/; with the intrinsic split to @_ handy
and it ups the line noise factor. Also, change
foreach$h(@i) to just for(@_) and
change all the references from $h to $_ which again ups the
ugly.
Also, you can test for integer-ness on division with
if(!($_%$n)) rather than
if($_/$n==int($_/$n)) Beyond that you can
change $m=$m+$_ into $m+=$_
All of that got it to 612 chars. I beat it down
to about 473 chars but actually made it MORE readable
in the process. =P Oh well. Good one, BTW. I had fun
figuring it all out. Hopefully the tips above will make
you even more dangerous in the future.
--
$you = new YOU;
honk() if $you->love(perl)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.