Michael Corgan wrote:
> 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;
> }
> 
        @ARGV holds the params passed to the script, so you can use @ARGV or
transfer the info to your array.

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


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

Reply via email to