dimanche 30 juillet 2017

PERL And Statement Not Evaluating Properly

I am using Perl to send out an email. Pending some criteria I want to use a particular template for that email. To decide what template to use, I am setting some boolean statements. When $isA is 1 and isBis 1, my script is using templateB instead of templateA.

    if ($isA== 1 && $isB == 1)
    {
            @TEMP = @templateA;
            print "\n templateA\n\n\n";
    }
    elsif ($A == 1 && $B == 0)
    {
        print "\nEXTRA CHECK FT:" . $A. " ENC:" . $B. " ReApp:" . $C;
            @TEMP = @templateB;
            print "\n templateB\n\n\n";
    }
    elsif ($A== 0 && $B== 1)
    {
            @TEMP = @templateC;
            print "\n templateC\n\n\n";
    }
    elsif ($C== 1)
    {
            @TEMP = @templateD;
            print "\n templateD\n\n\n";
    }
    else
    {
            @TEMP = @templateE;
            print "\n templateE\n\n\n";
    }    

Any ideas on why this is not working?

Aucun commentaire:

Enregistrer un commentaire