in reply to Re: file type
in thread file type

Yes, I came across new things. As you suggested I unable to find any other betterway. On my unix system File::MMagic is not available. So I am opening each file and searching for either c or C++ type comments and deciding the language it belongs. I unable to go by file extention. Since I came across with various extentions like .c, .C, .cpp, .CPP, .cxx,.CXX,.pc, .PC etc. Thanks Ashok

Replies are listed 'Best First'.
Re: Re: Re: file type
by sierrathedog04 (Hermit) on Feb 09, 2001 at 16:39 UTC
    As best as I can tell, Perl's built-in grep command does not look inside an unopened file for you.

    But if that is what you want to do, why not use grep and the backtick operator? It is even possible that Grep may avoid scanning in a whole file if it knows that a pattern has failed halfway through.

    Even if grep doesn't exist on a Windows system you can always use the GNU port of grep which is available here.