#!/usr/bin/perl use IO::File; $/ = "%"; open(FILE, "/home/hagus/.signature.rot"); while () { $tmp = $_; $tmp =~ s/%//g; push @a, $tmp; } close(FILE); my $fh = new IO::File("/dev/urandom", "r"); my $foo = $fh->read($value, 100); $fh->close(); my $num = unpack("S*", $value); my $index = $num % (@a + 0); open(FILE, ">/home/hagus/.signature"); print FILE $a[$index] . "\n"; close(FILE);