sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
Background: If $foo{$bar} exists I want to take the value into a variable, increment the number then reassign it to the database. If $foo{$bar} doesn't exist I assign a value of 0 then increment the same way.
One last question, I was told I had to nest my statements if I wanted to do use an If inside of another If statement an so forth. Problem was I searched the site and the web for what 'nests' are and didn't find anything. Do they mean empty blocks like I'm using?
Thanks so much for your help!
{ if (exists $dbm{$lost}) { $youlose = $dbm{$lost}; $youlose++; $dbm{$lost} = $youlose; } else { $dbm{$lost} = 0; $youlose = $dbm{$lost}; $youlose++; $dbm{$lost} = $youlose; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: database unclarity when finding 'unitinitaliazed' everywhere
by pg (Canon) on Mar 17, 2003 at 02:56 UTC | |
by sulfericacid (Deacon) on Mar 17, 2003 at 07:30 UTC | |
|
Re: database unclarity when finding 'unitinitaliazed' everywhere
by The Mad Hatter (Priest) on Mar 17, 2003 at 03:04 UTC | |
by sulfericacid (Deacon) on Mar 17, 2003 at 07:32 UTC | |
by The Mad Hatter (Priest) on Mar 18, 2003 at 00:32 UTC | |
|
Re: database unclarity when finding 'unitinitaliazed' everywhere
by robartes (Priest) on Mar 17, 2003 at 07:23 UTC | |
by sulfericacid (Deacon) on Mar 17, 2003 at 07:42 UTC |