@ARGV has nothing at all to do with <STDIN>. One is an array of command line arguements. One is an input stream.
If your old program was reading from <>, and you were sending it information through STDIN, than you were employing bad practice, as you should have been reading from <STDIN>, and not <> (the diamdond opperator.)
Now if you want the arguement to be a random line in dict, than one easy way to go about this is to record the ammount of lines, and read from the file and skip until $. = the random number between 1..LAST_LINE. Because code size is an issue that solution is probably the best for you.
Evan Carroll
www.EvanCarroll.com