in reply to Why is IPC::Open2 behaving differently in a .pm?
No way to tell without knowing what program is and does. I've coded program as follows
#!/usr/bin/perl $_ = <STDIN>; chomp; print "foo => '$_'";
and both the command line version and the module version worked as expected after changing
- print $in q|some json|; + print $in "some json\n";
Maybe you have to set local $| = 1; inside your MyPack.pm (see perlvars)? Looks like a buffering issue - despite --unbuffered ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is IPC::Open2 behaving differently in a .pm?
by sendu (Initiate) on Aug 17, 2015 at 09:48 UTC | |
by tye (Sage) on Aug 17, 2015 at 14:35 UTC | |
by sendu (Initiate) on Aug 17, 2015 at 15:40 UTC |