in reply to Re: (jeffa) Re: Using list elements within lists contexts with the distributive properties of HTML shortcuts
in thread Using list elements within lists contexts with the distributive properties of HTML shortcuts

Sure, i will discuss the a() shortcut and let you apply it to the others.

Each shortcut takes an optional reference to a list and distrubutes it across each element. That you know, but when you try to do this via:

a( {-href=>$_ }, \@list )
the default variable is not 'associated' with the list reference. Indeed, the enumeration of the elements is done outside of your scope.

The only way (that i know of) to 'associate' it is to use a loop instead:

for (@list) { print a({-href=>$_},$_); } # or print a({-href=>$_},$_) for @list; # or print map {a({-href=>$_},$_) } @list;

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
  • Comment on (jeffa) 3Re: Using list elements within lists contexts with the distributive properties of HTML shortcuts
  • Select or Download Code

Replies are listed 'Best First'.
Re: (jeffa) 3Re: Using list elements within lists contexts with the distributive properties of HTML shortcuts
by Anonymous Monk on Jun 09, 2002 at 21:42 UTC

    Thanks again. The murk is thinning slowly, just rather more slowly than I would care to admit.