next up previous contents index
Next: Hashes Up: Arrays Previous: Arrays   Contents   Index


In HTML you use the <ol> tag.

The HTML:

    <html><head><title>Ordered Lists</title></head>
    <body>
    Bedrock
    <ol>
        <li>Fred
        <li>Barney
        <li>Wilma
        <li>Betty
        <li>Pebbles
        <li>Bamm Bamm
    </ol>
    </body></html>

will look like:

Bedrock

  1. Fred
  2. Barney
  3. Wilma
  4. Betty
  5. Pebbles
  6. Bamm Bamm
In perl, the name of an array starts with a ``@'' and, like a scalar, continues with alphanumerics or underscores not begining with a number.

    @bedrock = ("Fred", "Barney", "Wilma", "Betty", 
            "Pebbles", "Bamm Bamm") ;

To retrieve an item of the list ( In perl the numbers of array items begin with 0 ):

    print "$bedrock[0]\n" ;

will print:

    Fred

and

    print "bedrock[3]\n" ;

will print:

    Betty



Tom Hunt 2002-06-09