in reply to first perl example from perl book
If you then revert to the original ".=" code, you get this result:C:\Code>perl averages.pl kim: 50 Average: 50 lee: 75 Average: 75
Clearly, when you do a concatenation, you add data repeatedly to the hash. When you just assign, you get only the last data entry read.C:\Code>perl averages.pl kim: 90 90 95 100 50 Average: 85 lee: 99 100 75 Average: 91.3333333333333
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: first perl example from perl book
by convenientstore (Pilgrim) on Jan 15, 2008 at 16:30 UTC |