Lance Prais wrote:
>
> 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: $!";
> }
>
i don't think there is anything wrong with your "or" syntax. it does what
you expect it to do. i can offer a few tips:
1. try print what $partition contain before any of your 'if' statement to
see what is really there.
2. check your 'open()' calls! for example, instead of:
open(CSP_ALERTSFILE,">$csp_alters_index_txt_filename");
try:
open(CSP_ALERTSFILE,">$csp_alters_index_txt_filename") || die $!;
3. you really don't need the any(qw//) stuff for a simple 'if' statement. if
you decided to use it anyway, i don't think you need the "" inside qw//.
hope that gives you some hints.
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]