in reply to Small Code Snippet from PHP to Perl
After looking past what I thing was probably a bug, the steps for solving this using DBI are:
If there is any possibility that this script might be run concurrently with another process that also touches the same output file, be sure to properly flock your output file.
Additional reading: perlintro, open, perlsyn (for a discussion of while loops), perlsub (for a discussion of lexical variables), DBI, perlopentut, print, close, flock.
Each of the seven steps above is a small amount of code. With the exception of step one, we're talking about a single statement or line of code per step. It would take fewer keystrokes for me to just write it for you than it does for me to explain it, but that's not what PerlMonks is here for. This site is for educational, and arguably recreational purposes. Let me know which step you get stuck on, and provide the code you've written so far, and I'll gladly help you get past the tricky part.
Dave
|
|---|