Gossamer Forum
Home : General : Perl Programming :

what is || in variable declaration

Quote Reply
what is || in variable declaration
what does the following mean?
Code:
my ($server_auth) = $ENV{'REMOTE_USER'} || $ENV{'AUTH_USER'};
Quote Reply
Re: [delicia] what is || in variable declaration In reply to
Hi,

That basically tells $server_auth to either get the value of $ENV{'REMOTE_USER'} OR (if $ENV{'REMOTE_USER'} doesn't exist), look for $ENV{'AUTH_USER'}

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!