Date: Sun, 18 Jan 2004 15:55:42 -0800 From: Gary Kline <kline@thought.org> To: FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG> Subject: OT: Another perl question Message-ID: <20040118235542.GA41663@tao.thought.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040118235542.GA41663>
