in reply to Re: Why Would HTML::LinkExtor return a hash of attributes?
in thread Why Would HTML::LinkExtor return a hash of attributes?

Isn't it a hash?

Why does it have "key => val, key => val" if it isn't?

Plus, if it isn't, why does the sub grab it as:

my($tag, %links) = @_;
if it isn't a hash?

 all that sub needs to be is print "@_\n" Try it. You get both the "HREF" and the thing it's a link to. I don't want to extract "HREF" 5,000 times do I?
--

($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Replies are listed 'Best First'.
Re: Re: Re: Why Would HTML::LinkExtor return a hash of attributes?
by PodMaster (Abbot) on Aug 19, 2002 at 05:44 UTC
     => Is a fancy comma (,). It allows you to say
    print I => AM => NOT => QUOTING => WORDS => TIMES => 5;
    which would print IAMNOTQUOTINGWORDSTIMES5

    Using this fancy comma doesn't make a hash. A hash is a "data structure", and I => AM => NOT => QUOTING => WORDS => TIMES => 5 is a list.

    Now you can do many things with lists. You can create arrays ( also data structures )

    my @ARRAY = ( I => AM => NOT => QUOTING => WORDS => TIMES => 5 );
    and you can create hashes
    my %HASH = ( I => AM => NOT => QUOTING => WORDS => TIMES => 5 );
    . Do you follow now?

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.