But I like that the thread author used int().. it shows foresight and understanding of basic programming principles.
That comes from years of BASIC, Pascal, VB(A) etc. While new to Perl, I'm not new to programming. I'm trying to learn Perl in the same way that I moved from ZX81 BASIC and that is through a lot of reading and a greater deal of trial and error. *grin*
The thing with Perl, which isn't as flexible in most other languages, is the number of shortcuts of shortcuts that are available. Using int() seemed reasonable but it's great that there is a shortcut of this by using sprintf. Hopefully, with a bit of time and a lot of effort, I'll get the hang of the shortcuts.
Oh, the days of int(rnd(1)*100)+1 *grin*
Cheers! :)
In reply to Re^4: Formatting randomised data
by Manawydan
in thread Formatting randomised data
by Manawydan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |