Javeed Sar wrote:
> 
> Hi All,

Hello,

> I have a folder, this folder REMARK, this folder should have only one file
> with filextension  .DSP or .VBP.only one file should exist, if it is  not
> there we can add that file to folder.
> it already exist it should not add the file, it should come out with error
> "proj exist".
> 
> i.e folder REMARK should either have a file with extn .DSP or .VBP not both,
> only one file with .DSP or .VBP extn...


my @files = grep /\.(?:dsp|vbp)$/i, <REMARK/*>;

if ( @files == 1 ) {
    warn "proj exist\n";
    }
else {
    # do something else
    }



John
-- 
use Perl;
program
fulfillment

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

Reply via email to