On Mon, 12 Aug 2002, Javeed SAR wrote: > > > I have a small doubt; > > > My script is given below: > What it is doing is once the first condition is satisfied it is dieing, that > is if (($check_out == 0) > > I want the if statement to compare this also: > (($var5 == "Soarian_Context_Sensitive_Coordination_File") | ($var5 == > "comEPRHelp") | ($var5 == "CDMS_Context_Sensitive_Coordination_File") | > > > > am i doing something wrong?? > > > > #!c:\perl\bin\perl > > $PN="$ENV{'CLEARCASE_PN'}"; > ($FNAME, $FEXTENSION)=split(/\./,$PN); > ($var1,$var2,$var3,$var4,$var5) = split(/\\/,$FNAME); > > $check_out="$ENV{'CLEARCASE_RESERVED'}"; > if (($check_out == 0) && (($var5 == > "Soarian_Context_Sensitive_Coordination_File") | ($var5 == "comEPRHelp") | > ($var5 == "CDMS_Context_Sensitive_Coordination_File") | ($var5 == > "CDMS_Soarian_ToC_1.2b") | ($var5 == "CDMScomEPRHelp")))
You should be using eq for comparing strings. Instead of these multiple conditions why not create a hash of files that cannot be checkedout. Something like, my %cannot_co = ( comEPRHelp => 1, ....); After this your condition will be if (($check_out == 0) && (exists ($cannot_co{$var5}))) { die "...." } Makes it more readable and a lot easier to maintain. > > {#die (); > die "The element ($var5) is not allowed to be > checkedout(unreserved).please contact Clearcase administrator or javeed > (Extn 4919).\n"; > } > > > Regards > Javeed > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]