random numbers generators

Where can I find a script in Perl that generate random numbers for a web page?

Thanks
wireframAsked:
Who is Participating?
 
ventolinConnect With a Mentor Commented:
Here is a simple cgi that will print out a random number....

-Philip

______________cut here______________>
#/usr/bin/perl

# simple cgi for experts exchange

# Require Libraries.
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
$CGI::POST_MAX=1024 * 100; # max 100k posts
$CGI::DISABLE_UPLOADS = 1; # no uploads

# Start the HTML
print header("-expires"=>'now');
print start_html("-title"=>'Philip s Random Number',
                "-author"=>'philip',
                "-dtd"=>'-//W3C//DTD HTML 3.2//EN',
                "-BGCOLOR"=>'#ffffff');

# init random with time or current PID
srand(time|$$);
# where it stops nobody knows... but it will be a random num from 0 to 1000
my $value = rand (1000);
# tell the browser this value
print $value;

# end the document
print end_html;

# end the script
__END__

yo adrienne!!!!



0
 
ozoCommented:
print rand;
0
 
wireframAuthor Commented:
Can you be a little bit more specific? I type "print rand;" where? I don't need a script or something?

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
wireframAuthor Commented:
Thanks
0
 
wireframAuthor Commented:
How can I close the question and give my points?
0
 
ventolinCommented:
you already did.
0
 
wireframAuthor Commented:
what do I have to do so my previous Q don't show any longer with <pack> next to it?

How long will they stay there? One is 6 months old!
0
 
ventolinCommented:
you'll want to ask someone who runs this service (which isn't me):

http://www.experts-exchange.com/Customer_Service/Experts_Exchange/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.