From owner-freebsd-questions@FreeBSD.ORG Tue Feb 10 08:56:57 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B914616A4CE for ; Tue, 10 Feb 2004 08:56:57 -0800 (PST) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C1FD43D1F for ; Tue, 10 Feb 2004 08:56:57 -0800 (PST) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.7p1+Sun/8.11.7) id i1AGmnX07002; Tue, 10 Feb 2004 11:48:49 -0500 (EST) From: Jerry McAllister Message-Id: <200402101648.i1AGmnX07002@clunix.cl.msu.edu> To: jcm@FreeBSD-uk.eu.org (Jonathon McKitrick) Date: Tue, 10 Feb 2004 11:48:48 -0500 (EST) In-Reply-To: <20040210154416.GB33394@dogma.freebsd-uk.eu.org> from "Jonathon McKitrick" at Feb 10, 2004 03:44:16 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Choosing between sh and perl for system scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 16:56:57 -0000 > > > Now that I have a desktop workstation and network, I'm trying to learn the > true admin side of BSD, such as the periodic tasks, and how to automate > things. I see perl all over the system, and I know it's powerful and easy > to use. What might help me decide which tool would be best for the scripts > I want to write? Probably the two main things to consider are what type of processing you will be doing and how much it will be used. Perl is great for text processing - grabbing things out of text streams, mashing it around, creating easily searched and manipulated tables of that sort of stuff. It is not really so good at anything that needs a lot of floating point number crunching. Perl handles CGIs for web stuff pretty well unless you are getting thousands of hits on something. Then it can be a little slow. Or, if it involves talking to a database, maybe you would prefer PHP for that part of things. Perl is good for scripts that get used now and then. But, it is kind of big so if the script is likely to be used a lot - every second or so, then you will want to use something leaner. Probably either sh or even write it in C. Some people crab about Perl being less secure, but I think that is mostly like everything else. A poorly written script will be insecure in any language. A well written script will be more secure. Since Perl handles all your data types for you, you do not have so much of a problem of overrunning buffers, which is where most cracks develop in the UNIX world. So, in that sense, Perl can be more secure than C code. If you need something that runs in single user mode, then you will want to use sh for that. ////jerry > > NOTE: Please CC me, as I am not currently subscribed. Thanks. > > jm > -- > My other computer is your windows box. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >