When I read about this Module it really was not clear about using it with
strings.

I tried it with the following code and it is causing so many problems.  If
anyone has any Ideas it would be appreciated, I have been pounding my head
with this for a while now.


                if ($partition eq "Public"){
                        open(PUBLIC_ALERTSFILE,">$public_alerts_index_txt_filename");
                        print PUBLIC_ALERTSFILE"$oid". "::" ."$title". "::"
.."$partition". "::" ."$date\n";
                        close(PUBLIC_ALERTSFILE)                || die "can't close 
$file: $!";
                }
                if ($partition eq any(qw/"Public" "OPSEC SDK")){
                        open(OPSEC_ALERTSFILE,">$opsec_alerts_index_txt_filename");
                        print OPSEC_ALERTSFILE"$oid". "::" ."$title". "::"
.."$partition". "::" ."$date\n";
                        close(OPSEC_ALERTSFILE)                || die "can't close 
$file: $!";
                }
                if ($partition eq any(qw/"Public" "OPSEC SDK" "Gold/Platinum")){

open(ADVANCED_ALERTSFILE,">$advanced_alerts_index_txt_filename");
                        print ADVANCED_ALERTSFILE"$oid". "::" ."$title". "::"
.."$partition". "::" ."$date\n";
                        close(ADVANCED_ALERTSFILE)                || die "can't close 
$file: $!";
                }
                if ($partition eq any(qw/"Public" "OPSEC SDK" "Gold/Platinum" "CSP")){
                        open(CSP_ALERTSFILE,">$csp_alerts_index_txt_filename");
                        print CSP_ALERTSFILE"$oid". "::" ."$title". "::"
.."$partition". "::" ."$date\n";
                        close(CSP_ALERTSFILE)                || die "can't close 
$file: $!";
                }

Thank you in advance

Lance

-----Original Message-----
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 3:16 AM
To: [EMAIL PROTECTED]
Subject: Re: "Or" Syntax

Lance Prais wrote at Fri, 27 Sep 2002 01:55:31 +0200:

> If a=b or a=c or a=d do this     How would I do that?
>
> I thought I could do it like this but it did not work.
>
> 1.
> If ($a=b) || ($a=c) || ($a=d)
> {
> DO this
> }
>
> 2.
> If ($a=b) || if ($a=c) ||  if ($a=d)
> {
> DO this
> }

If there are some things to compare with for equality,
it's sometime also a good idea to use a hash for a direct lookup:

my %valid_value = map {$_ => 1} (qw/b c d));
if ($valid_value{$a}) {
   ...
}


If time doesn't play any role, but nice code does,
there's also the

use Quantum::Superpositions;
if ($a == any(qw/b c d)) {
   ...
}

way.


Greetings,
Janek


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


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

Reply via email to