Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Perl shell and autologout Message-ID: <11064@jpl-devvax.JPL.NASA.GOV> Date: 15 Jan 91 19:51:07 GMT References: <91Jan15.065631est.19297@me.utoronto.ca> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 28 In article <91Jan15.065631est.19297@me.utoronto.ca> eastick@me.utoronto.ca (Doug Eastick) writes: : I'm writing a simple shell/menu-system using perl. The menu will : probably look something like this: : : M) Mail : N) News : S) Shell : L) Logout : : Choice>> _ : : How can I implement an autologout (this perl program is their login : shell) similar to csh? It'll be a vanilla 4.2 BSD system on a ns32k. : Me thinks there is a fork() involved. If you have a recent version, you can just call alarm($SECONDS) right before you prompt, and either let the signal blow you away, or set $SIG{'ALRM'} = 'HANDLER'; : Also, any tips or hazards I should be aware of using a Perl program as : a login shell? You'll want to give them a way to set up their environment, probably. As long as the script isn't running as root there should be no problem, but if it happens to be running setuid, be careful what you eval. taintperl can help some if that's the case. Larry