----- Original Message ----- 
From: "Javeed SAR" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 6:44 PM
Subject: errrorrrrrrr


> hi,
> 
> 
> What i am doing in this script, if .vbp or .dsp exists the $counter should
> be incremented.
> If $counter >=1 it should say the projct already exist.
> 

See inline comments =)


> 
> 
> I have a doubt, it is giving syntax  error as follows:
> 
> syntax error at \\blrk35ed\javeed\proj.pl line 51, near "}"
> Execution of \\blrk35ed\javeed\proj.pl aborted due to compilation errors.
> 
> Am i doing something wrong in my script
> 
> 
> #!c:\perl\bin\perl 

use strict;

> #!c:\post\postie\postie.exe

What is this for ?

> 
> $counter=0;
my $counter = 0;

> $PN="$ENV{'CLEARCASE_PN'}";

What is this again ? I never seen this %ENV key.
Anybody can tell me what is this ?

> ($FNAME, $FEXTENSION)=split(/\./,$PN);

my ($FNAME, $FEXTENSION) = split /\./, $PN;

However, what will happen if a file name is
'my.document.a.file.txt' ? you will get FNAME = 'my'
and FEXTENSION = 'document'. The other parts are missed.

you may try this :
my ($FNAME, $FEXTENSION) = ($1, $2) = m/^(\S+)\.(\S+)$/;

> $SMTP_SERVER="132.186.192.2";

my $SMTP_SERVER= '132.186.192.2';

> $SUBJECT="ADDED DSP/VBP PROJECT TO CLEARCASE(NOTE: THIS IS AUTOMATICALLY
> GENERATED MAIL MESSAGE.)";

my $SUBJECT = '.....';

> #@EMAIL_TO_LIST =("SAR.Javeed\@sisl.co.in","Manoj.Panda\@sisl.co.in");
> @EMAIL_TO_LIST1=("SAR.Javeed\@sisl.co.in");

my @EMAIL_TO_LIST1 = ('[EMAIL PROTECTED]');

> my $DATE_TIME=localtime;

> my @MSG = 
> ("   User:$ENV{'CLEARCASE_USER'}\n
>      Date:$DATE_TIME\n
>   Element:$ENV{'CLEARCASE_XPN'}\n
>   Comment:$ENV{'CLEARCASE_COMMENT'}\n");
> 

Where are those %ENV keys comes from ????

> open(FD,">\\\\blrk35ed\\temp\\testblat.txt"); 

You can use this :

my $file = '\\blrk35ed\temp....txt';
open FD, ">$file";

>      foreach $msg(@MSG){ 
>          print FD $msg; 
>          print "\n"; 
>          } 
>         close(FD); 
> 
You can shortly write the above loop by :

print FD $msgline."\n" for my $msgline (@MSG);

> $msg = join("",@MSG); 
> $msg=~ s/\\/\\\\/g;
> $FEXTENSION=~ s/\\/\\\\/g;

I don't understand the above 2 lines meaning....

> 
> if (($FEXTENSION =~ /^vbp$/i) || ($FEXTENSION =~ /^dsp$/i))
>  {$counter=$counter+1; }
> 

you can replace the above by :

$counter++ if ($FEXTENSION =~ /^(vbs|dsp)$/);

but do you sure that's what you want ?? or do you need this :

$counter++ if ($FEXTENSION =~ /\.(vbs|dsp)$/); # I don't know.

Finally, I bet a guess( but I hope this is only because I
am not well known enough). Those $ENV values are what you
mean to data getting by form (GET or POST), if so, that's
not the case. You have to write something to pick up those
data. %ENV are values generated by server, as a short report.
You may refer to CGI.pm to pick up those data comming from
a form.

Rgds,
Connie

PS.. I think I am quite stupid recent time, always unable to 
understand what those OPs are asking... I better works harder
to study English....



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

Reply via email to