blackadder has asked for the wisdom of the Perl Monks concerning the following question:

Hi all

I have this
$perms->Add("$acc", FULL|FULL, ACCESS_ALLOWED_ACE_TYPE, OBJECT_INHERI +T_ACE | CONTAINER_INHERIT_ACE);
Which works fine, howver if try this
my $var1 = 'FULL'; my $var2 = 'FULL'; $perms->Add("$acc", $var1|$var1, ACCESS_ALLOWED_ACE_TYPE, OBJECT_INHE +RIT_ACE | CONTAINER_INHERIT_ACE);
It doesn't work. i get the following error
Argument "FULL" isn't numeric in subroutine entry at C:\Perl\myscript.pl line 360.
Can someone advice me what I need to do to get the variables to work please
Regards

Replies are listed 'Best First'.
Re: Variables and Perms Add
by fglock (Vicar) on Sep 12, 2002 at 13:52 UTC
    my $var1 = FULL; my $var2 = FULL;

    FULL is a constant; 'FULL' is a string.

Re: Variables and Perms Add
by PodMaster (Abbot) on Sep 12, 2002 at 13:56 UTC
    | is the bitwise or operator, and as you know from perlop, it works on numbers and strings, but what is "FULL".

    my $var1 = 'FULL'; # string 'FULL'

    my $var1 = FULL; # i'm guessing a CONSTANT, which has a numberic value

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      It works without the quotes.
      You are correct I should have remembered this from my elementary Perl readings, but sometime my mind does draw a blank.

      THANKS...