On Sep 9, david said:
>Jeff 'Japhy' Pinyan wrote:
>
>> I really that's too much work. The -t file test should be sufficient:
>
>your version only checks to see is STDIN is attached to a tty. for example,
>run your script from a crontab and you see will it never prints the usage.
>(ie, it always t
Jeff 'Japhy' Pinyan wrote:
> On Sep 9, Kevin Pfeiffer said:
>
>>In article <[EMAIL PROTECTED]>, David wrote:
>>
>>[...]
>>> [panda]$ html.pl
>>> no input
>>> [panda]$ html.pl file.html
>>> get file file.html
>>> [panda]$ echo "hi" | html.pl
>>> get line hi
>>> [panda]$
>>>
>>> perldoc -f select
>
On Sep 9, Kevin Pfeiffer said:
>In article <[EMAIL PROTECTED]>, David wrote:
>
>[...]
>> [panda]$ html.pl
>> no input
>> [panda]$ html.pl file.html
>> get file file.html
>> [panda]$ echo "hi" | html.pl
>> get line hi
>> [panda]$
>>
>> perldoc -f select
>> perldoc IO::Select
>
>Thanks! This is what
In article <[EMAIL PROTECTED]>, David wrote:
[...]
> [panda]$ html.pl
> no input
> [panda]$ html.pl file.html
> get file file.html
> [panda]$ echo "hi" | html.pl
> get line hi
> [panda]$
>
> perldoc -f select
> perldoc IO::Select
Thanks! This is what I was thinking of; I'll take a look.
--
K
Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
>
>> "R. Joseph Newton" wrote:
>>>
>>> Kevin Pfeiffer wrote:
>>>
>>> > I'm looking at HTML::TokeParser. It expects a scalar with a filename
>>> > or a reference to a scalar containing the data to parse.
>>> >
>>> > Thi
On Sep 9, R. Joseph Newton said:
>> >> Kevin Pfeiffer wrote:
>> >>
>> >> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or
>> >> > a reference to a scalar containing the data to parse.
>
>Not the provlem at all, Kevin. The problem is those damned extra
>operators, in this
Kevin Pfeiffer wrote:
> In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
>
> > "R. Joseph Newton" wrote:
> >>
> >> Kevin Pfeiffer wrote:
> >>
> >> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or
> >> > a reference to a scalar containing the data to parse.
> >> >
> >>
I deleted the original message by mistake, but here's your answer: you
want to use the -t file test.
if (@ARGV) {
# getting input via command-line arg
$html = shift;
}
elsif (-t STDIN) {
# STDIN is the user's terminal (as opposed to a piped stream)
usage();
}
else {
In article <[EMAIL PROTECTED]>, John W. Krahn wrote:
> "R. Joseph Newton" wrote:
>>
>> Kevin Pfeiffer wrote:
>>
>> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or
>> > a reference to a scalar containing the data to parse.
>> >
>> > This works fine:
>> >
>> > my $html;
>
"R. Joseph Newton" wrote:
>
> Kevin Pfeiffer wrote:
>
> > I'm looking at HTML::TokeParser. It expects a scalar with a filename or a
> > reference to a scalar containing the data to parse.
> >
> > This works fine:
> >
> > my $html;
> > if (@ARGV) { # get filename for T
Kevin Pfeiffer wrote:
> I'm looking at HTML::TokeParser. It expects a scalar with a filename or a
> reference to a scalar containing the data to parse.
>
> This works fine:
>
> my $html;
> if (@ARGV) { # get filename for TokeParser
> $html = shift;
> } else {
> my
11 matches
Mail list logo