Hey guys, I could really use some help.
I've got a desktop application in Perl running on Windows that grabs data and writes it to a formatted file, and opens the file for viewing in its own view program.
The problem is that, if the viewer program of the file (notepad, googEarth, etc), isn't already open, the call to open the file never returns home and my program hangs.
Im using
print "Opening file: $File\r\n";
my $returnValue = system($File);
# my $returnValue = exec($File);
print "Done. ReturnValue $returnValue\r\n";
So if the data viewing program is already open I'm fine and it runs great. If however I open the file and the viewer is not open, Perl will hang at the system or exec calls waiting for the exe to quit. Is there a way to spawn the system call in a separate thread or some other means such that I'm not hanging the program waiting for the user to close the viewing exe?
Thanks!
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.