From owner-freebsd-questions@FreeBSD.ORG Sun Jan 18 15:55:46 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 F1BD416A4CE for ; Sun, 18 Jan 2004 15:55:46 -0800 (PST) Received: from sage.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5F6143D3F for ; Sun, 18 Jan 2004 15:55:45 -0800 (PST) (envelope-from kline@thought.org) Received: from thought.org (root@tao [10.0.0.247]) by sage.thought.org (8.12.9/8.11.4) with ESMTP id i0INtkGH050926 for ; Sun, 18 Jan 2004 15:55:48 -0800 (PST) (envelope-from kline@thought.org) Received: (from kline@localhost) by thought.org (8.12.6/8.11.3) id i0INtgYD047326 for freebsd-questions@FreeBSD.ORG; Sun, 18 Jan 2004 15:55:42 -0800 (PST) (envelope-from kline) Date: Sun, 18 Jan 2004 15:55:42 -0800 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20040118235542.GA41663@tao.thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing 17 years of service to the Unix community User-Agent: Mutt/1.5.5.1i Subject: OT: Another perl question 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: Sun, 18 Jan 2004 23:55:47 -0000 Is there an easy way of determining "file - determine file type" in perl? at least as certain as magic(5) can ascertain? E.g: if (($ftype = file ($ARV[i])) eq "script){ ## do abc; } else if ($ftype eq "Mail"){ ## do def; } else if ($type eq "C program"){ ## do xyz; } . . . I've been poking around perl tutorial sites; so far, nada. Thought I'd ask the wizards. thanks for any clues, gary -- Gary Kline kline@thought.org www.thought.org Public service Unix