Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Okay, an insane use for Perl?

I'd definately have to say using it to control the guidance system of weapons of mass destruction.

Where's the code?

It's non-existant! Who's insane enough to do that?

But just for fun

#!/usr/bin/perl # Nukem v0.01 (untested) # Classified: Top Secret # # This code is to be considered alpha # Use of this code is strictly forbidden # except if given explict orders # by the President to Nukem. # use strict; # We're trying to blow up the enemy, not ourselves! use warnings; # So we need a bit of sanity here. # use the Weapons of Mass Destruction module use Weapons::MassDestruction; use Command::Protocols; use Time::HiRes qw(usleep); # Create a new command protocol object using the current protocols my $protocol = Command::Protocols->new(); # Create a new W::MD object that represents a nuclear missile passing +a # reference to the protocol object so that we don't need to # pass it everytime we need info from it my $nuke = Weapons::MassDestruction->new( -protocol => \$protocol, -nuclear => 1 ); # Arm it $nuke->arm(); # Aim it $nuke->aim(); # Fire! $nuke->fire(); while(1) { # Never assume that it will not stray if (!$nuke->oncourse()) { $nuke->course_correct(); } # listen for an override signal if ($protocol->override()) { # change the destination to the alternate location residing # somewhere that minimalizes death and destruction of innocents $nuke->alt_course()); } # Is 100 microseconds too long to sleep between course corrections? # If it misses the target, we will never know... # we'll be vaporized :( usleep(100); }

In reply to Re: Insane Uses for Perl by Mr. Muskrat
in thread Insane Uses for Perl by Sigmund

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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, 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, 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (6)
    As of 2020-10-27 18:10 GMT
    Find Nodes?
      Voting Booth?
      My favourite web site is:

      Results (257 votes). Check out past polls.