Can I ask why this is in a module? It doesn't do anything besides make a round-about way of calling rand()... Perhaps adding functionality of passing ranges for the numbers to be picked from would improve this. Not to mention that this is a complete waste of the purpose of OO programming. :(
Other than that, here's the way I replace your whole module:
#!/usr/bin/perl -w use strict; my $num = rand();
Update: If this is simply your first try at creating a module, then I suppose I'd say you accomplished that nicely. You know how to export functions and do a couple of small things, so good job. Now all you need to learn is how to keep data within an object (separate from other objects) and how to manipulate this data. Good start though :P
If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.
In reply to Re: Random number generator
by Coruscate
in thread Random number generator
by Chady
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |