Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm of aware of something exactly like that, although I've hacked stuff similar to it over, e.g., Math::Prime::TiedArray [cpan.org] when playing at Project Euler [projecteuler.net]. In fact, gathering all those is_(prime|abundant|fibonacci|*) functions under a Number::Class (still trying to find a better name for it) module is something I want to do when I'll have truckloads of round tuits to spend (ah!).

  • perl -MNumber::Properties=prime \
         -MList::MoreUtils=lastval \
         -E '$x = lastval { prime } 2 .. Inf;
             say "the largest prime number is $x"'
    --
    rjbs