Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to approach this problem, or should I ignore it?

by jethro (Monsignor)
on Apr 07, 2010 at 17:54 UTC ( [id://833362]=note: print w/replies, xml ) Need Help??


in reply to How to approach this problem, or should I ignore it?

I hope your script is well designed with subroutines to do the difficult tasks ;-). In that case you probably have a subroutine to generate a row of the html table. Then you just need to insert the following code (adapted to your circumstances, $x has a different name in your script):

$opcode=$x->{opcode}; while (@{$x->{subfields}}) { @params= splice(@{$x->{subfields}},0,5); generate_html_row($opcode,@params); $opcode=''; }

Beware, this changes your datastructure. if you can't have that, make a copy of @{$x->{subfields}} and loop over the copy

If you don't have that subroutine it should be easy to extract the relevant code and make it one. Ok, you could do the same inline, but readability is much better with subroutines for distinct tasks

Replies are listed 'Best First'.
Re^2: How to approach this problem, or should I ignore it?
by jedikaiti (Hermit) on Apr 08, 2010 at 16:05 UTC
    Thanks, jethro!
    Kaiti
    Swiss Army Nerd

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-20 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found