For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2006 > Re: how do I avoiding zombie processes without interfering with " die if system(









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: how do I avoiding zombie processes without interfering with " die if system(
usenet@DavidFilmer.com

2006-01-10, 4:02 am

Rahul wrote:
> die if system("ls")
> die if system("rm ..")


You will have FAR fewer problems if you stop treating Perl like bash or
ksh (which are simply frameworks to execute system commands) and start
treating Perl like a programming language with its own system
interaction command set. Instead of shelling out to system calls to do
stuff like this, use Perl functions (such as readdir and unlink,
instead of 'ls' and 'rm').

Every time you execute a system command, you invoke a new shell
instance. Stop doing that, and your problems will (most likely) simply
go away.

--
http://DavidFilmer.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com