in reply to Jammed FH pipe
Start by not using a global var (*SNMP). If you insist, at least localize it. If it ceases to exist, it's hard for it to be "jammed".
Fixed along with *many* other problems:
sub { my ($target, $table, $fieldstring, $comstr) = @_; my @cmd = ( mibtable => ( -table => $table, -fields => $fieldstring, -node => $target, ); open(my $fr_child, '-|', @cmd) or die("Can't launch $cmd[0]: $!\n"); while (<$fr_child>) { # do stuff } close($fr_child) or die("Can't wait for child: $!\n"); die("Child died from signal ", ($? & 0x7F), "\n") if $? & 0x7F; die("Child died with code ", ($? >> 8), "\n") if $? >> 8; print("Child exited successfully\n"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Jammed FH pipe
by gryf (Novice) on Oct 07, 2009 at 22:21 UTC | |
by ikegami (Patriarch) on Oct 07, 2009 at 22:57 UTC | |
by cdarke (Prior) on Oct 08, 2009 at 07:20 UTC |