You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by martin langhoff <ma...@scim.net> on 2000/08/02 22:41:15 UTC
each() and Table shortcuts
hi,
is there a way to use the excellent <table> shortcuts that embperl has
with each()?
I'm mainly concerned with a tied hash that hides a huge database, and
this approach :
[- @keys = keys %large_db; -]
<table>
<tr>
<td>
[+ $keys[$row] +]
...
will eat ram like hell, just to never release it ...
and of course I don't want to stop using Emperl's table shortcuts ... I
know how to do it with a [$foreach$] block ...
martin
Re: each() and Table shortcuts
Posted by Gerald Richter <ri...@ecos.de>.
>
> is there a way to use the excellent <table> shortcuts that embperl has
> with each()?
>
> I'm mainly concerned with a tied hash that hides a huge database, and
> this approach :
>
> [- @keys = keys %large_db; -]
> <table>
> <tr>
> <td>
> [+ $keys[$row] +]
> ...
>
> will eat ram like hell, just to never release it ...
>
> and of course I don't want to stop using Emperl's table shortcuts ... I
> know how to do it with a [$foreach$] block ...
>
In this case a [$ while ($k, $v) = each (%hash) $] is the only solution.
(You may get it working with Embperl's table feature, but then it becomes
very confusing, so I recomend to use while.
Gerald