Perl has a file globbing operator for situations like this.
try
@projectFilesExist = <$ja\{*.dsp,*.vbp}>;
print "proj already exist\n" if @projectFilesExist;
< > returns an array of files matching the pattern between the
angle brackets. The @projectFilesExist will be convert to scalar
context in the if and will evaluate to true if there are any
elements in it.
Javeed SAR wrote:
> Hi,
>
> I am getting a path from variable $ja,if i print $ja i get:
> M:\jav_test\ADT\View_Controller_VB\SDKComponents\ADTModel
> Note: this path varies everytime.
>
> $file=`ls $ja`;
>
> If i excute above statement ,In the directory ADTModel, i get a list of
> files,i have to grep for files with extension(.dsp and .vbp) in this
> folder,if files with this extension exist i should quit with print message
> "proj already exist" else i should be able to sendmail.
>
> What is the regular expression?
>
> TIA
>
> jav
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]