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.
- Posted at 23:33
| comment (0)
TrackBack URL:
http://kichiki.hp.infoseek.co.jp/cgi-bin/blosxom.cgi/blosxom/20040110-diary2blosxom.trackback
Writebacks so far
(0)