On Jan 6, 2004, at 9:32 AM, [EMAIL PROTECTED] wrote:
[..]
So, 1. from within perl.script, how can one tell if the input stream is
coming from
STDIN or a file that was opened by <>?
2. If input stream is not coming from STDIN, but a file, how can one
tell which file is the current file (assuming mul
From: [EMAIL PROTECTED]
> As I understand it, <> operator will open all items in @ARGV allowing
> one to do a shell command line of
>
>perl.script file1 file2 file3
>
> and inside perl.script you only need
>
> while (<>) { ... syntax to read all the files on the command line.
>
>
> <> wi
>So, 1. from within perl.script, how can one tell if the input stream is
>coming from STDIN or a file that was opened by <>?
Use select
>2. If input stream is not coming from STDIN, but a file, how can one
>tell which file is the current file (assuming multiple files were
>specified on the co
t;STDIN" probably imply much more than I mean for them
to convey.
I hope this is more clear. And again, thanks for your help.
- Paul
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 06, 2004 11:20 AM
To: Perl Beginners Mailing List
Subject: Re: Wh
[EMAIL PROTECTED] wrote:
>
> Case 3. (this is the difficult case for me) the script is invoked
> with no file and no pipe to it. I would like the script to
> end quietly, such as
>>test.input.source
>>
>
> Instead, it waits for input.
>
>> test.input.source
> no command line args - switching t
On Jan 6, 2004, at 3:17 PM, [EMAIL PROTECTED] wrote:
Case 3. (this is the difficult case for me) the script is
invoked with no file and no pipe to it. I would like the
script to end quietly
die usage() if @ARGV == 0 and -t;
I didn't show you how to check for the pipe (-p) because
this should pr
[EMAIL PROTECTED] wrote:
> >So, 1. from within perl.script, how can one tell if the input stream is
> >coming from STDIN or a file that was opened by <>?
>
> Use select
>
> >2. If input stream is not coming from STDIN, but a file, how can one
> >tell which file is the current file (assuming multip
[EMAIL PROTECTED] wrote:
> Thanks for the help drieux.
>
> I could have been more explicit in my question to have stated that
> I want perl.script to exit quietly if there are no files on the
> command line or if not invoked as the recipient of piped output.
So what have you tried to adjust the c
[EMAIL PROTECTED] wrote:
>
> As I understand it, <> operator will open all items in @ARGV allowing
> one to do a shell command line of
>
>perl.script file1 file2 file3
>
> and inside perl.script you only need
>
> while (<>) { ... syntax to read all the files on the command line.
>
> <> wil
On Jan 6, 2004, at 1:07 PM, david wrote:
[EMAIL PROTECTED] wrote:
Case 3. (this is the difficult case for me) the script is invoked
with no file and no pipe to it. I would like the script to
end quietly, such as
test.input.source
Instead, it waits for input.
test.input.source
no command line a
On Jan 7, 2004, at 1:10 PM, drieux wrote:
On Jan 6, 2004, at 12:53 PM, Steve Grazzini wrote:
die usage() if @ARGV == 0 and -t;
You might not want to test if there is a
controlling terminal
I want to test whether STDIN (the default argument for -t)
is hooked up to the terminal (which is what -t te
On Jan 6, 2004, at 12:17 PM, [EMAIL PROTECTED] wrote:
[..]
It just dawned on me that I may not be using the
correct terminology since "pipe" and "STDIN" probably
imply much more than I mean for them to convey.
[..]
This is a good angst point to raise.
Technically STDIN|STDOUT|STDERR denote
merely
On Jan 7, 2004, at 10:37 AM, Steve Grazzini wrote:
[..]
I want to test whether STDIN (the default argument for -t)
is hooked up to the terminal (which is what -t tells you) so
that doesn't block waiting for user input.
[..]
I have absolutely no problem with the idea that
one wants to use '-t' to
On Jan 7, 2004, at 2:57 PM, drieux wrote:
But simply because there is no controlling
terminal does NOT mean that there is nothing on STDIN.
Were you reading that code backwards?
die usage() if @ARGV == 0 and -t;
# if ((THERE ARE NO FILENAMES IN ARGV) &&
# (STDIN IS HOOKED UP TO A TERMIN
On Jan 7, 2004, at 12:42 PM, Steve Grazzini wrote:
On Jan 7, 2004, at 2:57 PM, drieux wrote:
But simply because there is no controlling
terminal does NOT mean that there is nothing on STDIN.
Were you reading that code backwards?
die usage() if @ARGV == 0 and -t;
# if ((THERE ARE NO FILENAMES
15 matches
Mail list logo