in reply to Re: Quickie Alarm Clock
in thread Quickie Alarm Clock

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!

Replies are listed 'Best First'.
Re: Re: Re: Quickie Alarm Clock
by jsprat (Curate) on Sep 11, 2002 at 00:52 UTC
    (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.
      

Re: Re: Re: Quickie Alarm Clock
by Juerd (Abbot) on Sep 11, 2002 at 12:42 UTC

    (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.