On Fri, 15 Dec 2000, Jose Quesada wrote:

>Date: Fri, 15 Dec 2000 00:44:59 -0700
>Subject: Ambiguous use of text => resolved to "text"
>
>Hi,

        Hy, Mr. Quesada.

>I'm playing around with Parse::HTML, and using one of the examples,
>I get the next error:
>
>    Ambiguous use of text => resolved to "text" at line 26
>
>Here is the code, line 26 is marked with #######
>!/usr/bin/perl -w

# this is highly relevant... ;-)
>sub text
>{
>    return if $inside{script} || $inside{style};
>    print $_[0];
>}
>
>HTML::Parser->new(api_version => 3,
>    handlers    => [start => [\&tag, "tagname, '+1'"],
>      end   => [\&tag, "tagname, '-1'"],
>      text  => [\&text, "dtext"], ############
>     ],
>    marked_sections => 1,
> )->parse_file(shift) || die "Can't open file: $!\n";;
>
>The script works, but I'm terribly curious about this error. Can someone
>help me?

        There is a sub and a hash key (a bareword) with the same name.
        What perl is trying to say you is that it choose to interpret the
bareword 'text' as a string ("text") and not as a sub call ( &text() ).

        Thats why perl says 'Ambiguous use of text => resolved to
"text"'... 
        
        Hope that helps... 

foreach( @friends ){ send +( $gender ? &kisses($_) : &bracez($_) ); }

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Luis 'Champs' de Carvalho           @  @     @
Sys Admin @ tbn.com.br             @@@ @@ @@@@
Phone:+55(011)3879.1300 (R.7036)    @  @@ @
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Reply via email to