Re: How to name STDIN from the command line

2003-01-23 Thread david
Rob Dixon wrote: > That's kinda fancy! > > Any reason it's not: > > my @buffer = <>; > > :-? > no. i like yours. just somehow miss it. :-) david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to name STDIN from the command line

2003-01-23 Thread Rob Dixon
David wrote: > > push(my @buffer,<>); That's kinda fancy! Any reason it's not: my @buffer = <>; :-? Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to name STDIN from the command line

2003-01-23 Thread Rob Dixon
Michael Corgan wrote: > I used the ARGV earlier, but received errors. So this is how the > script looks now: > #! /usr/local/bin/perl -w > use strict; > # > # > # > > $/ = "\n%\n"; It looks like your file contains records separated by a % on its own on a line? There are much better ways of doing

RE: How to name STDIN from the command line

2003-01-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Michael Corgan wrote: > What I'm trying to write is a script to randomly write to standard > output questions in a file everytime I execute the script. I seem to > be getting these errors, though and I'm just not sure what I'm doing > wrong. I'm not sure what the errors are telling me. > >

RE: How to name STDIN from the command line

2003-01-23 Thread david
Michael Corgan wrote: > What I'm trying to write is a script to randomly write to standard output > questions in a file everytime I execute the script. I seem to be getting > these errors, though and I'm just not sure what I'm doing wrong. I'm not > sure what the errors are telling me. > have

RE: How to name STDIN from the command line

2003-01-23 Thread Michael Corgan
;Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: 'Michael Corgan' <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: RE: How to name STDIN from the command line Date: Thu, 23 Jan 2003 15:14:17 -0600 Michael Corgan wrote: > I used the ARGV ear

RE: How to name STDIN from the command line

2003-01-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Michael Corgan wrote: > I used the ARGV earlier, but received errors. So this is how the > script looks now: > #! /usr/local/bin/perl -w > use strict; > # > # > # > > $/ = "\n%\n"; > > while (<>) { > my $random = rand(@ARGV); > my $question = $ARGV[$random]; > chomp $ques

RE: How to name STDIN from the command line

2003-01-23 Thread Michael Corgan
d value at /home/mcorgan/bin/flash line 13, <> chunk 2. Aren't I initializing the values with the "my" before the scalar variables? From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: 'Michael Corgan' <[EMAIL PROT

RE: How to name STDIN from the command line

2003-01-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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)