My first thought was how about using the speaker and using perl to drive some midi or wav player.

But how about this freshmeat registered project on sourceforge? "usb-robot lets you quickly prototype USB device drivers in almost any language Perl, Python or whatever. You can even try out your ideas by directly typing in USB commands from the console."

Likewise, perl-libusb is a Perl XS/XSUB interface to the libusb library, to allow you to program/talk to USB devices from user space under Linux or FreeBSD.

Also check out Perl Serial Programming Resources and here is a document on connecting circuits to your computer via parallel port, usb, etc. I'm not a hardware guru but it has examples of safe circuits and bad ones, covers windows and dos, controlling the port from the web, optoisolators and solid state relays for controlling high power levels, circuit diagrams and links to other resources and kits, etc. You may be able to use one of the CPAN modules with it though it also provides some C code and tells you how to use it. Maybe someone with hardware experience would like to mention their opinion of this apparently comprehensive doc.

Finally, this Single Channel Control Line linked from the above article looks like it might be the answer to your question. It describes construction of a simple alarm driving circuit, with photos, circuit diagrams, a parts list, how to create the circuit board, and so on. Regardless of what country you are in, my guess is that any university or electronics company could handle the circuit side for you if you are not experienced with it, but it also has links to an online electronics course e.g. on parallel port interfacing (the Printer Port section in the robotut linked page).

Hope this helps. How about reporting back after you solve your problem?


In reply to Re: Using Perl to make a hot-lead from any port by mattr
in thread Using Perl to make a hot-lead from any port by Petras

Title:
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, 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:
    & &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.