in reply to I need help

Did I wrong something. Pls let me know. Thanks

Yes, for example when I run your program I get

$ perl doviprolldie 1 2 3...*SNIP*...5999 6000 Undefined subroutine &main::tally called at doviprolldie line 13.

So you print @array ... and then the program ends

Is this what you wanted to happen?

Have you written out the steps to solve this problem , in (english) words? Can I see that?