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;
>> > if (@ARGV) { # get filename for TokeParser
>> > $html = shift;
>> > } else {
>> > my @html = <>;
>>
>> Where is the diamond operator here supposed to be filled from?
>
> <> treats the elements of @ARGV as file names and opens them in order
> and returns their contents but if @ARGV is empty it returns the contents
> of STDIN.
This is what I'm stuck on - is there a way to determine if STDIN is
getting/is going to get/has gotten any contents?
I thought I would just check with "unless @html...", but the script never
gets that far, it's waiting for <STDIN> which never arrives.
$ ./myscript
I just thought that if @ARGV is empty and nothing is being piped to the
script that I should be able to print a usage message.
--
Kevin Pfeiffer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]