Help with arrays...

Mark Ingram mark.ingram at
Mon Aug 11 14:05:16 UTC 2003

i basically want to list every version of every product, so i need a
multi-dimensional array?

Product A
    Version 1.0
    Version 2.0
Product B
    Version 1.1
    Version 2.1
Product C
    Version 1.2
    Version 2.2

etc etc.

  -----Original Message-----
  From: developers-owner at
[mailto:developers-owner at]On Behalf Of Mark Ingram
  Sent: 11 August 2003 13:24
  To: Bugzilla Dev List
  Subject: Help with arrays...


  i need help referencing members of an array in a template. I have the
following code and i cant seem to access what i want:

      my %products;
      my %versions;

      foreach my $p (@enterable_products) {
          if (CanEnterProduct($p))
              $products{$p} = $::proddesc{$p};
              $versions{$p} = {"1.0", "2.0", "3.0"};

    $vars->{'proddesc'} = \%products;
    $vars->{'versions'} = \%versions;

  In the template i have a loop going through each product, which works

  [% FOREACH p = proddesc.keys.sort %]
  [% END %]

  but i want to try to access the difference versions of each product too, i
have tried

       [% actual = proddesc.$p %]
       [% FOREACH ver = versions.$actual %]
           [% ver %]
       [% END %]

  and numerous other ways, but to no avail.

  Can anyone help me out?


       Mark Ingram
        Software Engineer
        Nexsan Technologies
        33 - 35 Parker Centre
        Mansfield Road
        DE21 4SZ
        United Kingdom
        p: +44 01332 291600
        f: +44 01332 291616
        e: mark.ingram at

        The next generation now!

        Best Enterprise Storage

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the developers mailing list