[PR]テレビ番組表
今夜の番組チェック

Jan 10, 2004 (Sat)

/blosxom

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.
perm link - Posted at 23:33 | comment (0)