use CGI; print a( {-href=>"dummy" }, \@list );
this produces an anchor for each element of @list, but how do I get the value of each list element substututed at "dummy"?
I tried $_ and $list. The former produces no errors and no ouput. The latter (with -w and strict in force) gives:
Global symbol "$list" requires explicit package name at ...
I am also fairly sure that by using [] judiciously in the next line:
print table( Tr( td( a( {-href=>"dummy"}, \@list ) ) ) ) );
I should be able to produce a table, with a single column of anchors (ie. TABLE TR TD A.../A /TD /TR repeat /TABLE ) but my attempts at forcing A to provide a list context to td() and td() to provide a list to Tr() have got nowhere?
Thanks for any pointers.
Meta-discusion: It would be a useful feature if along with the PM approved html markup, a small table of the appropriate substitutions for entities that should be used, like []etc. was also there .... it took me a while to realise why these weren't showing up in my preview.
In reply to Using list elements within lists contexts with the distributive properties of HTML shortcuts by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |