$allowed = $username eq 'admin' ? 1 : 0;
Can someone explain me this line? I don't get the ? 1 : 0 part
They say it need to be used instead of $allowed = 1 if $username eq
'admin'; for a mod_perl env.
Etienne
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
If the username is equal to admin, $allowed is assigned 1 or else it is
assigned a value of 0.
Rex
-Original Message-
From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 30, 2001 9:56 AM
To: [EMAIL PROTECTED]
Subject: $a = $b eq "" ? 1 : 0;
$allowed = $u
assigned a value of 0.
>
> Rex
>
> -Original Message-
> From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 9:56 AM
> To: [EMAIL PROTECTED]
> Subject: $a = $b eq "" ? 1 : 0;
>
> $allowed = $username eq 'admin' ?
> -Original Message-
> From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 9:56 AM
> To: [EMAIL PROTECTED]
> Subject: $a = $b eq "" ? 1 : 0;
>
>
> $allowed = $username eq 'admin' ? 1 : 0;
>
> Can someone
> > $allowed = $username eq 'admin' ? 1 : 0;
> >
> > $allowed = 1 if $username eq 'admin';
>
> FWIW, that statement by itself has no relationship to mod_perl.
Well, I think the point is that mod_perl doesn't reset the value
of variables between runs so the second line may not do what
the progra
On Oct 30, Me said:
>> > $allowed = $username eq 'admin' ? 1 : 0;
>> >
>> > $allowed = 1 if $username eq 'admin';
>>
>> FWIW, that statement by itself has no relationship to mod_perl.
>
>Well, I think the point is that mod_perl doesn't reset the value
>of variables between runs so the second li
using $allowed = ($username eq 'admin');
how do I check for allowed? with 1 :0 I can do if ($allowed), do I need to do
if ($allowed eq "true")? If yes it's a little longer to write:-)
Etienne
Jeff 'japhy' Pinyan wrote:
> On Oct 30, Me said:
>
> >> > $allowed = $username eq 'admin' ? 1 : 0;
> >>
On Oct 30, Etienne Marcotte said:
>using $allowed = ($username eq 'admin');
>how do I check for allowed? with 1 :0 I can do if ($allowed), do I need to do
>if ($allowed eq "true")? If yes it's a little longer to write:-)
Did you bother looking at what eq returns? It returns 1 or '', which
means
> -Original Message-
> From: Me [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 1:05 PM
> To: Bob Showalter; 'Etienne Marcotte'; [EMAIL PROTECTED]
> Subject: Re: $a = $b eq "" ? 1 : 0;
>
>
> > > $allowed = $username eq '