Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Dynamic HTML::Template Database Template

by diotalevi (Canon)
on Oct 02, 2002 at 17:13 UTC ( [id://202325]=note: print w/replies, xml ) Need Help??


in reply to Dynamic HTML::Template Database Template

Nice. The only thing I really want to change about that is that double map on $row. I'm thinking that I'd really like to alter the arrays in place instead of making a new copy to (hopefully) keep the memory requirements lower.

# Jeffa rows => [ map {{ cols => [ map { { data => defined $_ ? encode_entities $_ : ' ' } } @$_ ] }} @$row ], # becomes -{diotalevi}-> my ($row, $value); for $row (@$rows) { for $value(@$row) { $value = { data => defined($value) ? encode_entities($value) : ' ' }; } $row = { cols => $row }; } # and later rows => \@rows

Update 0: I initially forgot to create the hash and array refs inline. My bad
Update 1: $row = { cols => $row } used to be $row = [ cols => $row ]
Update 2: rows => $rows was rows => \@rows

__SIG__
printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://202325]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-18 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found