Javeed Sar wrote at Wed, 21 Aug 2002 09:50:02 +0200:

> @file=`ls $ja`;
> 
> #Here the output is a list of files:
> cp.exe
> eula.txt
> test2.vbp.mkelem

Should this file matched too or not ?
I assume in my solution that it isn't.

> test3.vbp
> 
> 
> # I want to grep for files with  .dsp or .vbp  extensions  here, if the
> number of files with extension  .dsp or .vbp is > 1 i should exit saying
> project exists. or else send mail.
> 
> am i doing the right thing?
> 
> 
> @projectFilesExist = <$file\{*.dsp,*.vbp}>;
> if ($projectFilesExist> 1)
> {
>     die "\n\nThe element ($PN) is not allowed to be added to
> ClearCase,Because a project already exists.Please contact  Clearcase
> administrator or javeed (Extn 4919).\n";
> }
> else{
>     $cmd= `sendmail`;
> }

If I understand you right,
all you want is to find out, 
whether your current directory contains a file ending on .dsp or .vbp
and depending on that to make something:

use constant PROJECT_EXISTS_ERROR => <<EOE;


The element ($PN) is not allowed to be added to 
ClearCase,Because a project already exists.Please contact  Clearcase
administrator or javeed (Extn 4919).

EOE

opendir DIR, "." or die "Can't open current directory";
/\.dsp$/ || /\.vbp$/ and die PROJECT_EXISTS_ERROR while ($_ = readdir DIR);

# Now send a mail
# How to do it is written under
# perldoc -q "send mail"


Best Wishes,
Janek


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

Reply via email to