#!/usr/athena/bin/perl
#
# PROGRAM: 	randpickline.pl
# AUTHOR:  	Erik Nygren <nygren@mit.edu>
# DATE:		1/21/93
# USAGE:	randpickline file [files...]
# PURPOSE:	Randomly pick a line from one of the files
#		or from stdio if none specified
# CAVEATS:	Blank lines in input file may be picked
#

srand;		# Seed random number generator - otherwise always same result
@lines = <>;	# Load the files specified on the command line into @lines
print $lines[int(rand(scalar(@lines)))];	# Pick a line and print it
