Random.Org Perl API


This project is not owned or controlled by Random.Org, and operates independently with no connection to or association with Random.Org whatsoever. It works under absolutely NO implicit or explicit liability.

Quick Download

Download here. Support This Project Downloading this program is and will be always free, but your donation is always appreciated.

What is Random.Org Perl API?

Random.org is a website that provides various services related to generation of random numbers. One of these services is to get a set of random numbers based on various criteria as a webservice from the site. This project Random.Org Perl API has created a Perl interface to the APIs for the webservice provided by the site.

Currently, the project covers all 'Basic Methods' as provided by Random.Org. For APIs that involve digital signing, please contact me at verilog_tutorialhotmail.com.

Project Details


This project is distributed as an open source repository under Lesser GNU Public License (LGPL).

Download source

You can download sources in tar+gzipped from here. Use 'tar -zxvf ...' command to ungzip and untar.


The code is written using Perl. It is tested with Strawberry Perl 5.14.

Directory structure of the downloaded tree

Once uncompressed, the downloaded source will create a directory named randomorgperlapi-<Version number>. It will also create the following subdirectories under this directory.

  1. doc: Documentation directory.
  2. code: Home of the Perl code.

Example Usages

   $resultHash = 
     &fetchRandomDotOrg ($method
                       , $apiKey
	 	       , $numRand
	 	       , $minRange
	 	       , $maxRange
	 	       , $replacement
	 	       , $base
	 	       , $id
# User handling of response starts here
if (exists($resultHash->{'result'})) { 
   $randArray = $resultHash->{'result'}->{'random'}->{'data'};
} elsif (exists($resultHash->{'error'})) { 
   $randArray = []; # Return an empty array in case of error
} else { 
   die "Illegal JSON response from random.org containing neither result nor error";

print "@$randArray\n" if $debug;
# User handling of response ends here

$resultHash is user-defined variable in user code that contains the result of the webservice as mentioned.

Bug Reporting

Bugs can be reported here.

Your Generous Donation is Much Appreciated

While downloading this program is and will be always free, your donation is always appreciated. The suggested amount is $20, but any amount that you can afford will be gladly accepted. Please click on the icon below to donate.

Support This Project


My name is Swapnajit Mitra. I am the author and maintainer of this project. Contact me at verilog_tutorialhotmail.com.