in reply to Quickie Alarm Clock

I often use

perl -le'sleep 1 until localtime =~ / 07:/; sleep 1, print "\a" while +1;'

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Quickie Alarm Clock
by BrowserUk (Patriarch) on Sep 10, 2002 at 23:34 UTC

    Such flagrant prodigality and needless verbosity is begging for optimisation. 8^)

    (localtime)[2] == 7 and print "\a" while sleep 1

    (ps. the output from localtime doesn't have any ':'s? (in my version anyway))


    Well It's better than the Abottoire, but Yorkshire!
      (ps. the output from localtime doesn't have any ':'s? (in my version anyway))
      Really? In list context, (my version is AS 5.6.1 build 633) I get:

      perl -e "print localtime" 3481710810222521

      In scalar context, however, I get:

      perl -e "print scalar localtime" Tue Sep 10 17:48:09 2002 ^ ^

      I'm guessing that you are in the UK (aren't I a bright boy ;) - my locale (US) won't make a difference here

        I'm guessing that you are in the UK (aren't I a bright boy ;) - my locale (US) won't make a difference here

        Locales don't matter for the format of localtime's scalar value. For great justice.

        - Yes, I reinvent wheels.
        - Spam: Visit eurotraQ.
        

      (localtime)[2] == 7 and print "\a" while sleep 1

      Did you have to look up the localtime index? I saved some time by not doing that. Besides, your version only beeps for an hour ;)

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.