in reply to Dumb Mistakes
Only $string3 will have the correct value.my $value=0; my $string1=$value || "No value assigned" my $string2=$value ? $value : "No value assigned" my $string3=defined $value ? $value : "No value assigned"
What did I do as a mistake in my early stages? I underutilized modifiers leading to hard to read code, I had a lot of $var->{key}->{key}->{key}->{key} kind of stuff. Using temporary variables cleaned that up as well as learning that the form $var->{key}{key} is legit.
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Dumb Mistakes
by mirod (Canon) on Oct 03, 2001 at 16:06 UTC | |
by demerphq (Chancellor) on Oct 03, 2001 at 16:27 UTC |