#!/usr/bin/perl -w
#randomly selects a movie to be played
#and then plays the randomly selected movie

system("ls /home/mann/seatsale/shootingback/*.mpg > mpeglist.txt");
open (MPEGLIST, "< mpeglist.txt"); # open listfile for read only

while (defined ($filenames = <MPEGLIST>)) {
  @mpeglist = (@mpeglist,$filenames);
}#end while

print @mpeglist;
srand;
$movieselection = $mpeglist[rand(@mpeglist)]; # select a random movie

print "movie slected is ".$movieselection;
# plaympeg --double --fullscreen /home/mann/seatsale/shootingback/nn.mpg`;
system("plaympeg --double --fullscreen $movieselection");

