in reply to Is It Text-Editable???

You could use File::Type whos description is, "determine file type using magic". Sounds good to me. ;)

Derived from the POD:

my $file = 'path/to/filename.ext'; my $ft = File::Type->new(); my $type = $ft->checktype_filename( $file );

HTH!


Dave

Replies are listed 'Best First'.
Re: Re: Is It Text-Editable???
by Errto (Vicar) on Apr 28, 2004 at 02:56 UTC
    I'd be very curious to see how File::Type compares against file(1). Of course it obviously depends whose version of file(1) you're running. It's all about the clever heuristics.