mrd has asked for the wisdom of the Perl Monks concerning the following question:
I've read about the disadvantages of using IPC::Open2, but in my case it should be ok because, the communicating programs are all written by me and I can make sure that no OS buffering will stand in my way :)
Still, the following code snippet (mostly from perlipc) never raises an exception:
That 'xxx' program is of course not there and I would have expected $@ to be set. Instead $@ is empty so I can't do my error handling in this case.use strict; use IPC::Open2; use Carp; eval { open2(*RDRFH, *WTRFH, 'xxx'); }; if ($@) { if ($@ =~ /^open2/) { warn "open2 failed: $!\n$@\n"; return; } die; # reraise unforeseen exception }
I would appreciate a solution that does not involve additional CPAN modules or a more recent Perl.
My environment is described in the subject line.
Thanks your time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC::Open2, WinXP, Perl 5.6.1
by PodMaster (Abbot) on Feb 11, 2004 at 12:04 UTC | |
by mrd (Beadle) on Feb 11, 2004 at 12:53 UTC | |
by PodMaster (Abbot) on Feb 11, 2004 at 13:05 UTC | |
by mrd (Beadle) on Feb 11, 2004 at 14:34 UTC | |
by PodMaster (Abbot) on Feb 11, 2004 at 18:10 UTC | |
|