In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
(Jaya Kumaran) wrote:


>   In a directory there exist *.c and *.out files. Here *.out is 
>   created for every *.c file. I need to check whether .out is 
>   generated for all the .c file. How to achive this.


you can do something like so.  remember that glob and -e are going
to operate in the current working directory so you need to either
be in the directory of interest (perhaps with chdir()) or you
need to use the full path.

#!/usr/bin/perl

foreach( glob('*.c') )
        {
        my $out = $_;
        $out =~ s/\.c$/.obj/;

        print "Object file does not exist for $_\n"
                unless -e $out;
        }
-- 
brian d foy <[EMAIL PROTECTED]> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to