Is there any reason why you shuffle the output of the mysqldump through perl? You don't seem to do anything else with the data. Why not let a shell pipe do the work?
system("$cmd > $dumpfile")==0 or die ...;
Now to start two of them simultaneous you could do a fork (which is clean and easy). Small caveat: You can easily check whether the child process finished, but to get a status/success/failure message, you would need a file or some IPC. But don't worry, some helpful monk will probably tell you about a module that already does most of this.
Just for completeness sake: There is also the possibility of letting the shell fork:
system("$cmd > $dumpfile &")==0 or die ...;
The '&' makes sure the system call returns immediately, so that you can start the second dump directly afterwards. To find out whether the child finished you could check the output of ps, but that is a dirty und unsafe hack in my view.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.