next up previous contents index
Next: Boolean Expressions (True and Up: Hashes Previous: Hashes   Contents   Index


In HTML you use the <dl> tag.

Each pair has a key, the <dt> tag, and a value, the <dd> tag.

    <html><head><title>Dictionary Lists</title></head>

    <body>

    Flintstone

    <dl>

        <dt>father</dt> <dd>Fred</dd>

        <dt>mother</dt> <dd>Wilma</dd>

        <dt>child</dt> <dd>Pebbles</dd>

        <dt>pet</dt> <dd>Dino</dd>

    </dl>

    </body>

    </html>

will look like:

Flintstone

In perl, the name of a hash starts with a ``%''.

    %flintstone = (

    "father" => "Fred",

    "mother" => "Wilma",

    "child" => "Pebbles",

    "pet" => "Dino",

)

To retrieve the value of a key:

    print "$flintstone{"pet"}\n";

will print:

    Dino



Tom Hunt 2002-06-09