Try this.

$t->insert("end", &gettime);


--
Shekar


On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed <irfan_sayed2...@yahoo.com>wrote:

> i have to call localtime () function to get the latest time everytime when
> i print the lines using insert method
> i mean , i need to print the latest time in scrolled text box
>
> lets say :
>
> use Tk;
> $mw = MainWindow->new();
> my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
> $t->insert("end", "$c = \&gettime");
>
> sub gettime
> {
>  $c = localtime();
> return $c;
> }
>
> so whenever i call insert method , it shud call function gettime and print
> the latest time in the text box
> please suggest
>
> regards
> irfan
>
>
>
>
>
> ________________________________
>  From: Jim Gibson <jimsgib...@gmail.com>
> To: Perl Beginners <beginners@perl.org>
> Sent: Friday, August 24, 2012 11:13 AM
> Subject: Re: insert in perl tk
>
>
> On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:
>
> > thanks. this will help to print the contents of array on separate line.
> > however, if at all we need to call function then what is the syntax, how
> we can call that ?
>
> What function do you want to call? When do you want to call it? What does
> the function have to do with the array you want to print? What does it have
> to do with Tk?
>
> >
> > please suggest .
>
> Please let us know in more detail what you are trying to do.
>
> Thanks.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>

Reply via email to