Harry Rose

Home » Perl » Random

Random

An incredibly simple perl script, which echoes a random number to the terminal.

Not really much more to say about this, it returns a number between 0 and a given number and its usage is as follows.

You can download this script from here. Note that for use with other scripts that I've written, you will have to rename this to random and place it in your path. I just put file extensions on here to save potential problems with browsers.

$ random max_number
#!/usr/bin/perl
print int rand($ARGV[0]);