-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I spent much of the weekend trying to solve this problem without
success.
Maybe someone on this list can help!

I have a list of items in a hash keyed by a name that which I want to
present in a sorted list as:

A 
 Aadvard
      * Item 1
      * Item 2
 Adze
      * Item 1
      * Item 2
B 
 Boo
      * Item 1
      * Item 2 etc.

What i want to do is something like

[% FOREACH name_beginning_with = ["A"-"Z"] %]
   [% name_beginning_with %]
      [% # get keys that perl @my_names = grep
^\${name_beginning_with}, keys %names would return %]
      [% FOREACH name = my_names %]
          [% name %]
             [% FOREACH item = name.keys %]
                   * [% item.$key %]
             [% END %]
      [% END %]
[% END %]

I tried variations on

[% PERL %]
[% names = grep (^\${name_beginning_with}, names.keys) %]
[% END %]

but without much success and suspect I might need something like a
filter to give
the equivalent of grep.

Any advice or work arounds would be gratefully received.

Chris

- ---
Dr Chris P. Jobling [[EMAIL PROTECTED]]
Department of Electrical and Electronic Engineering
University of Wales Swansea, Singleton park, Swansea SA2 8PP, UK.
Tel: +44 1792 295580; Fax: +44 1792 295686
WWW: http:/www-ee.swan.ac.uk/DeptEEE/People/cv/cpj.html

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO5ZCW9pwTw/UK05SEQITDACfVv1OhA1oY8bwrqZsykMsuRr7OzgAnROD
H5vbvS/N05CtwzzGkQ4maNcr
=v7tu
-----END PGP SIGNATURE-----



Reply via email to