Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > interactive mode ` ` in perl script

Reply
Thread Tools

interactive mode ` ` in perl script

 
 
DGG
Guest
Posts: n/a
 
      03-02-2005
I have got a question arsing from my perl program.

Basically, I want to get the machine date and time, and display it on a
Tk label.

I am using ActivePerl, and running on DOS/Windows.
So I would use `date` to get the current date.

Though "date" has a silent mode. I am thinking in general, if assume
"date" only has an interactive mode. So after typing in "date", after
displaying the current date, the program also awaits an input (new date
setting or an ENTER) to complete.

As we are running inside a perl script, how can one imitate an
interactive input to feed into the program input?

Thanks guys

 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      03-02-2005
In article <(E-Mail Removed). com>, DGG
<(E-Mail Removed)> wrote:

> I have got a question arsing from my perl program.
>
> Basically, I want to get the machine date and time, and display it on a
> Tk label.
>
> I am using ActivePerl, and running on DOS/Windows.
> So I would use `date` to get the current date.
>
> Though "date" has a silent mode. I am thinking in general, if assume
> "date" only has an interactive mode. So after typing in "date", after
> displaying the current date, the program also awaits an input (new date
> setting or an ENTER) to complete.
>
> As we are running inside a perl script, how can one imitate an
> interactive input to feed into the program input?


There is no need to use an external command to get the date and time.
Use the Perl function localtime and perhaps one of the many
time-manipulation modules available from CPAN (like DateTime), or the
POSIX strftime function.

FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future,
and comp.lang.perl.tk for questions about Perl/TK.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      03-03-2005
DGG wrote:

> I am using ActivePerl, and running on DOS/Windows.
> So I would use `date` to get the current date.


I take it that you haven't tried using localtime() in scalar mode.
$date_as_a_string = localtime;

You should learn the difference between
print localtime(),"\n";
and
print localtime()."\n";
 
Reply With Quote
 
DGG
Guest
Posts: n/a
 
      03-04-2005
Thanks. I would never know this group is defunct now

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Running a python script from interactive mode Himanshu Python 0 11-18-2009 05:21 AM
Newbie: async mode dedicated versus async mode interactive!! Pink_Floyd Cisco 4 06-16-2006 12:16 AM
Executing python script in non-interactive mode on cygwin (windows) Pankaj Python 3 01-23-2006 08:15 AM
is interactive mode same as calculator mode? Alex Python 1 09-09-2005 12:54 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments