How do I name the STDIN from the command line. I'm trying to write a simple script to randomly pick a file from a file name I enter on the command line. This is what I have:

my @cards = (<>); #set stdin to @cards
while (<>) {
my $random = rand(@cards);
my $question = $cards[$random];
chomp $question;
print $question;
}

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to