Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Environmental Settings

by providencia (Pilgrim)
on Apr 28, 2000 at 18:25 UTC ( [id://9584]=note: print w/replies, xml ) Need Help??


in reply to Environmental Settings

I don't use system() when it's possible not to.
I've been using open(FH,"some_system_command any options |")
Then I just: $variable = <FH>.
I was told that using system() is costly because it forks another process and
isn't preferred with CGI. I'm a newbie and haven't done any CGI yet.
That's what I'm getting ready to do now.
Also there are some functions like chmod() and unlink() to name two
that do what some of the unix system commands do.
That's the least costly option.

Replies are listed 'Best First'.
RE: Re: Environmental Settings
by Adam (Vicar) on Apr 29, 2000 at 00:38 UTC
    Right, calling system() or `` does fork another process along with all the respective overhead. But I'm not sure that your method doesn't do this too. I've never seen that idea before. The way to check is to use perl to do a system call of a program that prints the current process list and then seeing which methods create an extra process to do this. I'd wager that they all do.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://9584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found