in reply to Turning a hash into a line of links

How about using map to construct a list of tags and then change the default list separator to the pipe symbol and just print the array.

#!/usr/bin/perl -l # use strict; use warnings; use CGI qw/:all *table'/; use English q{-no_match_vars}; my %sections = ( q{ DMA} => q{dma}, FST => q{dma/fst}, MRA => q{dma/mra}, BKS => q{bks}, MSU => q{dma/msu}, FMA => q{dma/fma}, FOMC => q{dma/FOMC}); print q{<h3 align='center'>}; my @aTags = map { a({-href => qq{/$sections{$_}}}, qq{$_ HOME}) } sort keys %sections; { local $LIST_SEPARATOR = q{|}; print qq{@aTags}; } print q{</h3>};

Here's the output, the script runs with the -l flag.

<h3 align='center'> <a href="/dma"> DMA HOME</a>|<a href="/bks">BKS HOME</a>|<a href="/dma +/fma">FMA HOME</a>|<a href="/dma/FOMC">FOMC HOME</a>|<a href="/dma/fs +t">FST HOME</a>|<a href="/dma/mra">MRA HOME</a>|<a href="/dma/msu">MS +U HOME</a> </h3>

This seems to do what you want.

Cheers,

JohnGG

Update: Added output.