Current location: Hot Scripts Forums » Programming Languages » Perl » without console


without console

Reply
  #1 (permalink)  
Old 01-01-04, 07:09 PM
freak freak is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Question without console

what shall i write in my script, so that when i save it to myscript.pl it won't open a window[consol] when i run it ?
Reply With Quote
  #2 (permalink)  
Old 01-01-04, 09:53 PM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
On a windows box where you have the .pl extension associated with Perl binary it will always open in a command box. What are you wanting it to do?

Normally, if I want to run a script on the command line I will open up a command box then run the script. If I'm coding for the web I'll run it through Apache.

~Charlie
Reply With Quote
  #3 (permalink)  
Old 01-02-04, 12:00 AM
freak freak is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
and can i somehow make it[myscript.pl or myscript.exe[after compiling it through perl2exe]] opoen every 24 hours ?
Reply With Quote
  #4 (permalink)  
Old 01-02-04, 12:34 AM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
I'm almost positive that windows (XP at least) has a built-in app called Task Scheuler that will do the trick. I also remeber using a command line utility called 'at' a while back on Windows NT. Other than that, I suggest Google: http://www.google.com/search?q=cron+for+windows

~Charlie
Reply With Quote
  #5 (permalink)  
Old 01-02-04, 12:53 AM
freak freak is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
but cant i do something in the script itself?
Reply With Quote
  #6 (permalink)  
Old 01-02-04, 01:03 AM
Chas Chas is offline
Coding Addict
 
Join Date: Oct 2003
Location: California
Posts: 359
Thanks: 0
Thanked 0 Times in 0 Posts
Not effectively, no. Your best bet is to use one of the options I mentioned above.

1) What happens if you reboot? If you set a timer in the script and reboot, you will have to restart the script every time to keep it runnig. If it's set up as s scheduled task, it will work automagically when the computer reboots.

2) It's just not a very clean way of doing it. You don't want the script constantly running in the background waiting for a timer to trip/reset. That's what cron and Task Scheduler are for.

~Charlie
Reply With Quote
  #7 (permalink)  
Old 01-02-04, 01:55 AM
freak freak is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

thank you very much
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 04:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.