in reply to random num generator

You could start with Perl's built-in rand function. Type the following at command-line to get the documentation on rand:

perldoc -f rand


What sort of data structure are you thinking about? I would probably store the elements in a hash table with gate ID as lookup key:
my %gates = ( 'gate001' => { 'gate_type' => 'FLIPFLOP', 'inputs' => [], # array of input values 'outputs' => [], # array of output values }, 'gate002' => { 'gate_type' => 'XOR', 'inputs' => [], # array of input values 'outputs' => [], # array of output values } );

If I want to insert 20 random input values between (-1.0, 1.0) to gate001:
for (1..20) { push @{$gates{'gate001'}{'inputs'}}, rand(2.0) - 1.0; }