### begin_: init perl use strict; use warnings; ### begin_: init vars my $sOut; my $oAlph = [('A' .. 'Z')]; my $oSubj = {}; $oSubj->{A} = [qw(africa asia)]; $oSubj->{B} = [qw(belgium brazil )]; my $oArti = {}; $oArti->{africa} = [qw(afone aftwo afthree )]; $oArti->{asia} = [qw(asone astwo )]; $oArti->{belgium} = [qw(beone)]; $oArti->{brazil} = [qw(brone)]; ### begin_: OutputTemplate ### ------------------ ### ------------------ $sOut .= " " .sLoop($oAlph,sub{ "$_ || " }) ."
" .sLoop([keys %{$oSubj}],sub{my $sLett=$_; "

$sLett

" .sLoop($oSubj->{$sLett},sub{my $sName=$_; "

$sName

" .sLoop($oArti->{$sName},sub{ "

$_

" }) }) }) . " " ; ### ------------------ ### ------------------ print $sOut; ### begin_: subroutines ### Simple Looping subroutine ### we use to make the perl code in our ### output template more compact sub sLoop { join"",map{$_[1]->();} (@{$_[0]}) }###end_sub ### begin_: end perl 1; __END__