in reply to Pick random item from list of unknown length?
What's the point of your request? Are you trying to void two lines? Easy:
sub pick_one { $_[rand(@_)] } while (<>) { chomp; print(pick_one(split(/,/)), "\n"); } [download]