I'd completely forgotten to do this. How about:
#!/usr/bin/perl use strict; use Time::HiRes qw( usleep ); my $hex_sec_of_day=0; my $HEX_SEC = 0.7585069444444; my $HEX_MS_IN_SEC = $HEX_SEC*1000000; sub calc_curr_time_as_hex() { my ($s,$m,$h,@rest)=localtime(time()); # my $s=58;my $m=59;my$h=23; # test data $hex_sec_of_day = (($s+($m*60)+($h*3600))*$HEX_SEC); } calc_curr_time_as_hex(); $|=1; while(1) { printf ("\r0x%04x ", $hex_sec_of_day); $hex_sec_of_day++; # day flips from 0xFFFE to 0x0000, move thi +s line # below next line to have midnight as 0xFFF +F $hex_sec_of_day=0x0000 if($hex_sec_of_day>0xffff); usleep($HEX_MS_IN_SEC); }

In reply to Re^4: hex clock by ciderpunx
in thread hex clock by ciderpunx

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.