OT: Another perl question

Gary Kline kline at thought.org
Sun Jan 18 15:55:47 PST 2004


	
	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 at thought.org   www.thought.org     Public service Unix



More information about the freebsd-questions mailing list