i have a simple gui perl/Tk code. It prints time, date and user-id. Is it possible to configure date variable so that my wnidow keeps updated with time change without any button click

#!/usr/bin/perl use Tk; $ashu="tan"; #color for main window $screen_resolution="800x400+200+100"; #size of main window $mw = new MainWindow(-background=>$ashu); $mw -> geometry($screen_resolution); $mw -> title("VENTURA"); $mw -> Label(-text=>"ventura disk space utilization tracker",-foregrou +nd=>"red",-background=>$ashu,-font=>"{Times New Roman} 20 normal roma +n") -> pack(); $user_id = `whoami`; $date = `date +%d%B%Y`; $time = `date +%T`; #--------------------------------------------------------------------- +---------- $INFO = $mw->Frame(-background=>$ashu)->pack(-side=>'top',-fill=>'both +', -pady=>10); $INFO->Button(-text => "$user_id",-width=>16,-height=>2,-relief=>"flat +",-foreground=>"white",-background=>$ashu,-font=>"{Times New Roman} 1 +0 normal roman")->grid(-row=>0,-column=>0,-padx=>45); $but_date = $INFO->Button(-textvariable => \$date,-command=>\$update_d +ate,-width=>16,-height=>2,-relief=>"flat",-foreground=>"white",-backg +round=>$ashu,-font=>"{Times New Roman} 10 normal roman")->grid(-row=> +0,-column=>1,-padx=>45); $but_time = $INFO->Button(-textvariable => \$time,-command=>\$update_t +ime,-width=>16,-height=>2,-relief=>"flat",-foreground=>"white",-backg +round=>$ashu,-font=>"{Times New Roman} 10 normal roman")->grid(-row=> +0,-column=>2,-padx=>45); #--------------------------------------------------------------------- +---------- MainLoop;

In reply to realtime time display in perl/Tk by bittoo1984

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.