Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: loops & sql results storage

by igelkott (Priest)
on Apr 19, 2008 at 16:30 UTC ( [id://681663]=note: print w/replies, xml ) Need Help??


in reply to loops & sql results storage

You've identified two methods (save to variable and save to file) but another reasonable alternative might be to rerun the original search in the other function. Sure it's wasteful but it's easy. Depends on the how long the database search takes and if the extra resources can be justified.

Otherwise, if you want to go the variable approach, you could just add push @results_1, [@array] after the if statement. If you don't want to deal with arrays of arrays and if you know that your possible results are limited in some way, you could simplify this to something like push @results_1, join('\t',@array) (blindly assuming tab isn't to be found in your output).

These suggestions are a bit sloppy but might be usable for a casual application.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-24 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found