Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Any source code for that? It sounds great. I'm a bit far off but have this so far works fine, although incomplete....

#!/usr/bin/perl $servertime = localtime (time); $x = 0; $Day = "Wed"; $Month = "Dec"; $Date = "5"; $Time = "10:15:30"; $Year = "2007"; $AudioFileName = "04 - Dido - Marys In India - EMG - www.elitemusic.e +s.vg.mp3"; $Player = "xmms"; print ("\r\n \r\n \r\n"); print ("-------------------------------------------------------------- +--------------- \r\n"); print ("Welcome To Dans Perl Alarm Clock For Linux\r\n"); print ("Created by Dan Gibas - http://www.hygen.net\r\n"); print ("-------------------------------------------------------------- +--------------- \r\n"); print ("\r\n \r\n \r\n"); print ("Hit ENTER to continue setup...\r\n"); $Begin = <STDIN>; print ("\r\n \r\n \r\n"); print ("Enter Alarm Day:\r\n\r\n"); print ("(Choose a number from 1 to 7)\r\n"); print ("1 = Mon\r\n"); print ("2 = Tue\r\n"); print ("3 = Wed\r\n"); print ("4 = Thu\r\n"); print ("5 = Fri\r\n"); print ("6 = Sat\r\n"); print ("7 = Sun\r\n"); $Day = <STDIN>; print ("Enter Alarm Month:\r\n\r\n"); print ("(Choose a number from 1 to 12)\r\n"); print ("1 = Jan\r\n"); print ("2 = Feb\r\n"); print ("3 = Mar\r\n"); print ("4 = Apr\r\n"); print ("5 = May\r\n"); print ("6 = Jun\r\n"); print ("7 = Jul\r\n"); print ("8 = Aug\r\n"); print ("9 = Sep\r\n"); print ("10 = Oct\r\n"); print ("11 = Nov\r\n"); print ("12 = Dec\r\n"); $Month = <STDIN>; if ($Day == 1){ $Day = "Mon"; } if ($Day == 2){ $Day = "Tue"; } if ($Day == 3){ $Day = "Wed"; } if ($Day == 4){ $Day = "Thu"; } if ($Day == 5){ $Day = "Fri"; } if ($Day == 6){ $Day = "Sat"; } if ($Day == 7){ $Day = "Sun"; } if ($Month == 1){ $Month = "Jan"; } if ($Month == 2){ $Month = "Feb"; } if ($Month == 3){ $Month = "Mar"; } if ($Month == 4){ $Month = "Apr"; } if ($Month == 5){ $Month = "May"; } if ($Month == 6){ $Month = "Jun"; } if ($Month == 7){ $Month = "Jul"; } if ($Month == 8){ $Month = "Aug"; } if ($Month == 9){ $Month = "Sep"; } if ($Month == 10){ $Month = "Oct"; } if ($Month == 11){ $Month = "Nov"; } if ($Month == 12){ $Month = "Dec"; } print ("\r\n \r\n \r\n"); print ("-------------------------------------------------------------- +--------------- \r\n"); print ("Alarm activated! \r\n"); print ("Alarm will go off at: $Day $Month $Date $Time $Year \r\n"); print ("Alarm will play: $AudioFileName \r\n"); print ("[^c to quit] \r\n"); print ("-------------------------------------------------------------- +--------------- \r\n"); while ($x < 10) { $servertime = localtime (time); if ($servertime eq "$Day $Month $Date $Time $Year"){ $x = 100; exec ("$Player \"$AudioFileName\""); } }

It uses a bit too much CPU but works...

more info here - http://www.hygen.net/blog/

Edit: g0n - code tags


In reply to Re^2: Alarm clock by Anonymous Monk
in thread Alarm clock by Anonymous Monk

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (4)
    As of 2014-08-22 00:27 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (144 votes), past polls