in reply to Random number generator

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.

Replies are listed 'Best First'.
Re: Re: Random number generator
by Chady (Priest) on Apr 01, 2003 at 17:16 UTC

    you probably need to look at the date of the post - read (April's Fool?)

    ;)
    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/

      Yeah, my reply was an april fool's too. Didn'cha know?

      Okay, so it wasn't lol. I noticed the date thing posted by someone else and it hit me like a sack of wet potatos. :) I can be such a sucker sometimes. I 70% fell for the cpan.org joke too.


      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.