- From: Mike Depot <mike@openair.com>
- Date: Wed, 3 May 2000 17:38:31 -0400
- To: "Pete Gelbman" <pete@arraycomm.com>, "Sebastian Lange" <lange@cyperfection.de>
- Cc: <micke@four04.com>, <html-tidy@w3.org>
Reading from and writing to another process at the same time in Perl is a real pain due to problems with buffering. You can easily get into a deadlock situation. Your best bet with tidy is to probably use a temp file. But having said that, if you're still really against it, look into the IPC::Open2 and IPC::Open3 modules. There's a good example of these in the Perl Cookbook, recipes 16.8 and 16.9. > Sebastian> The basic task is following: I have HTML content (just some text > Sebastian> with HTML tags, not a complete document) in a string variable and > Sebastian> want to pass this to Tidy via STDIN (no use of temporary files), > Sebastian> and then read Tidy's output (the tidied HTML content) into another > Sebastian> variable. All my attempts with perls open() function did not work > Sebastian> out so far.
Received on Wednesday, 3 May 2000 17:43:20 UTC