Jan 10, 2004 (Sat)
diary2blosxom.pl
-
diary2blosxom.pl: 1.7 2004/01/11 04:19:46 ichiki Exp
- (start): print attributes for HTML tags.
-
during writing the above, i learned "reference of hash" in Perl:
- in HTML::Parser, "attr" is a reference of hash.
-
$attr is passed to the routine "start" as
sub start { my ($tagname, $attr) = @_; ... -
there, the hash itself can be accessed via
%{$attr} as
while (($a, $c) = each (%{$attr})) { ... } -
also note that
- %hash = (a => Z, b => Y, ...);
- $hashref = {a => Z, b => Y, ...};
- %hash is equivalent to %{$hashref}
- $hash{a}, ${$hashref}{a}, $ $hashref{a}, and $hashref->{a} are all Z.




![]](/blosxom/images/digits/kichiki/rkichiki.gif)