#!/usr/bin/perl -w use strict; #pick a "random arg from a list" my @names = qw(ny.txt ca.txt nj.txt pa.txt ma.txt wa.txt); my $random_file = $names[rand(@names)]; #UPDATE: previous code had #an "off-by-one" error, Oops! print "$random_file\n";