David Wright wrote:
>
> excellent, thanks for two great answers. I actually tried (! defined)
> but i tried it on @storeList=<FILEIN>; which did not produce the
> desired results at all : -(
>
> John wrote:
> "The reason you are getting the warnings is because of $saveNum{$dup} on
> the right hand side of the expression. Use either:
> $saveNum{$dup}++;,..."
>
> Oddly enough, the above incrementing does not work on this example!!!!
> try it for yourself if you want.
I _did_ try it and it _does_ work, you are just doing it wrong.
> If you change $saveNum{$dup} =$saveNum{$dup}+1;
> to $saveNum{$dup} =$saveNum{$dup}++; it will not
> increment anything,
It _does_ increment $saveNum{$dup}, its just that you assign the value
to $saveNum{$dup} _before_ the increment is done.
> this actually through me off for awhile because i
> always write ++ (not +1) ,....
>
> well, i'll be $#%^&* i just ran the example with $saveNum{$dup} =
> ++$saveNum{$dup};
You are incrementing $saveNum{$dup} and then assigning the new value to
$saveNum{$dup}.
> and it works exactly like i wanted, i didn't think
> that would work?!,,....
Replace the line:
$saveNum{$dup} = $saveNum{$dup} + 1;
with:
$saveNum{$dup}++;
or:
$saveNum{$dup} += 1;
BUT NOT WITH:
$saveNum{$dup} = $saveNum{$dup}++;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]