Ever Get board, then think of something you have been meaning to do, like make a simple solution to a rather annoying problem? Well my problem was, I kept getting kicked off of my server cause I idle to long sometimes. So to save the hassle of having to reconnect, I came up with the little bit of code below. After I made this, my sys admin told me there is a way to set a variable in bash to keep it from timing you out, oh well, no useful code so go to waste so I say.

Here is the result of a few min's of boredom:

#!/usr/bin/perl -w #Script To Keep Term From Idling To long #To Avoid Being Dissconnected from Server #CTRL-C To Kill. #Happy Idling! use strict; print "\nKeep Me Alive! CTRL-C to Kill Once Started\n"; print "\nDo you Want To Put Me To Sleep Now?(y,n):"; my $answ; chomp($answ=<STDIN>); if ($answ=~ /y/) { &sleep } else{ print "\nFine, I didn't want a nap anyways!\n\n"; } sub sleep { my $sleep = sleep 30; &sleep; }


-- Yes, I am a criminal. My crime is that of curiosity.

Replies are listed 'Best First'.
Re: Boredom Does Strange Things
by maverick (Curate) on Jan 31, 2002 at 08:34 UTC
    hmmm...infinite recursion. So, how long does it take to smash the stack on your server? :)

    /\/\averick
    perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Re: Boredom Does Strange Things
by Anonymous Monk on Feb 01, 2002 at 21:49 UTC
    What's the Bash variable? :)
      "autologout"
      set autologout=0
      ...works in tcsh/csh and bash.

      Not really perl related at all, although I suppose it could become useful to someone, at some point.
      $ENV{AUTOLOGOUT}
      ...perl

      -xtype
Re: Boredom Does Strange Things
by Anonymous Monk on Feb 06, 2002 at 07:02 UTC
    I have been using perl for about 1 yr. I liked your program because it was simple for me to understand and an interesting idea at a level that I can easily relate to. paulc.
      I realised that after I wrote it. A re-write is in the works. After I finish the current project I'm working on.