Chat Server and Time Delay

Discussion in 'Perl Misc' started by Brian, May 4, 2004.

  1. Brian

    Brian Guest

    Hi All

    It's been a little while since I did some Perl coding
    and the questions I have are a little over my head.
    I need to write 2 scripts..........

    First one sits on a server and runs without being called
    from a browser. It's job is to check the time, and if
    the time = X then do Y. basically I want a script that
    is going to clear a MySQL Db at 4 am every day

    The second is way over my head, in short I need
    what is going to work like a chat server. The idea
    is I have a windows based program (witting in Delphi)
    that talks to a script, other uses of this program will
    also will also log on. The program will create messages
    and send them to the server script and in turn the
    script will send that message to all the other programs
    As I say just like a chat server except the messages are
    done via the program and not the user
    I have found a script on the net at
    http://hotwired.lycos.com/webmonkey/97/18/index2a.html?tw=programming
    but can't get it to work and don't really understand it.
    Can anybody point me in the right direction or have
    some example code?

    Brian
    Brian, May 4, 2004
    #1
    1. Advertising

  2. Brian wrote:

    > First one sits on a server and runs without being called
    > from a browser. It's job is to check the time, and if
    > the time = X then do Y. basically I want a script that
    > is going to clear a MySQL Db at 4 am every day

    use cron, or the equivalent on windows (Scheduled Tasks?). This will automatically execute a
    specified command according to whatever schedule you set.

    >
    > The second is way over my head, in short I need
    > what is going to work like a chat server. The idea

    <snip description of how client/server chat system works>

    > I have found a script on the net at
    > http://hotwired.lycos.com/webmonkey/97/18/index2a.html?tw=programming
    > but can't get it to work and don't really understand it.

    If you don't understand it then you're probably biting off more than you can chew. A quick look
    at it shows that it seems to cover the main points quite well, though I haven't tested it. There
    is a similar example in one of the books, though can't remember if it's the cookbook or
    Programming Perl (they're at home).

    Mark
    Mark Clements, May 5, 2004
    #2
    1. Advertising

  3. Brian

    Ben Morrow Guest

    Quoth Mark Clements <>:
    > Brian wrote:
    >
    > > First one sits on a server and runs without being called
    > > from a browser. It's job is to check the time, and if
    > > the time = X then do Y. basically I want a script that
    > > is going to clear a MySQL Db at 4 am every day

    >
    > use cron, or the equivalent on windows (Scheduled Tasks?). This will
    > automatically execute a specified command according to whatever schedule you
    > set.


    We seem to be getting this quite a lot atm. Would it be worth writing a
    faq answer?

    Ben

    --
    $.=1;*g=sub{print@_};sub r($$\$){my($w,$x,$y)=@_;for(keys%$x){/main/&&next;*p=$
    $x{$_};/(\w)::$/&&(r($w.$1,$x.$_,$y),next);$y eq\$p&&&g("$w$_")}};sub t{for(@_)
    {$f&&($_||&g(" "));$f=1;r"","::",$_;$_&&&g(chr(0012))}};t #
    $J::u::s::t, $a::n::eek:::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $.
    Ben Morrow, May 5, 2004
    #3
  4. Ben Morrow <> wrote:

    > Quoth Mark Clements <>:
    >> Brian wrote:
    >>
    >> > First one sits on a server and runs without being called
    >> > from a browser. It's job is to check the time, and if
    >> > the time = X then do Y. basically I want a script that
    >> > is going to clear a MySQL Db at 4 am every day

    >>
    >> use cron, or the equivalent on windows (Scheduled Tasks?). This
    >> will automatically execute a specified command according to
    >> whatever schedule you set.

    >
    > We seem to be getting this quite a lot atm. Would it be worth
    > writing a faq answer?


    It's not really a Perl problem, though, is it? Even if someone were to
    write a "canned" response for it, I very much doubt it would be added
    to the "official" Perl FAQ list. And what more can you say besides "use
    cron or the equivalent on your OS"?
    David K. Wall, May 5, 2004
    #4
  5. David K. Wall wrote:

    >>>use cron, or the equivalent on windows (Scheduled Tasks?). This
    >>>will automatically execute a specified command according to
    >>>whatever schedule you set.

    >>We seem to be getting this quite a lot atm. Would it be worth
    >>writing a faq answer?

    > It's not really a Perl problem, though, is it? Even if someone were to
    > write a "canned" response for it, I very much doubt it would be added
    > to the "official" Perl FAQ list. And what more can you say besides "use
    > cron or the equivalent on your OS"?

    As you say, it isn't really a Perl problem, but it is a faq for the list and therefore probably
    worthwhile. It could come under a section called somethings like "these aren't Perl questions
    but here's how you solve them." It may give posters a hint as to what constitutes a non-Perl
    question. That being said, you can lead a horse to water, but you can't make it drink.

    Mark
    Mark Clements, May 5, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand P Paralkar

    Input Delay and Hold Time

    Anand P Paralkar, Jan 16, 2004, in forum: VHDL
    Replies:
    4
    Views:
    10,262
    Alexander Gnusin
    Jan 20, 2004
  2. Scott Nonnenberg [MSFT]
    Replies:
    0
    Views:
    314
    Scott Nonnenberg [MSFT]
    Apr 6, 2005
  3. Scott Nonnenberg [MSFT]

    C# Language Chat next Thursday, 4/21 @ 1pm Pacific Time

    Scott Nonnenberg [MSFT], Apr 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    333
    Scott Nonnenberg [MSFT]
    Apr 14, 2005
  4. Replies:
    0
    Views:
    2,192
  5. flamesrock
    Replies:
    8
    Views:
    451
    Hendrik van Rooyen
    Nov 24, 2006
Loading...

Share This Page