hi
sorry ich vergas , ne ich rufe externes via IPC::open3 auf.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
sub _runexternal {
my ($shelf,$args) = @_;
my $dbg = \$args->{'debug'} ;
my $l=\$args->{'line'} ;
my $line = ${$l} ;
#$line =~ s/\&/\\\&/smx ;
if ( not ( $line ) ) { return ('255')};
my @response = ();
my @errors = ();
my $childpid = open3(\*CHLD_IN,\*CHLD_OUT, \*CHLD_ERR, $line);
use Symbol 'gensym'; #$err = gensym;
if ( ${$dbg} ) {
while (<CHLD_OUT>) {
$shelf->message({msg=>"[_runexternal]$_",debug=>${$dbg},v=>'vvvvvvv',});
push @response,$_;
}
} else {
@response = <CHLD_OUT>;
}
@errors = <CHLD_ERR>;
waitpid $childpid,0 or croak $ERRNO;
my $exitcode = $CHILD_ERROR >> ACHT;
push @response,$exitcode;
close CHLD_OUT or croak $ERRNO;
close CHLD_ERR or croak $ERRNO;
foreach my $r (@response) {
$shelf->message({msg=>"[_runexternal]$r",debug=>${$dbg},v=>'vvvvvvv',});
}
return (@response);
} # end sub _runexternal
Last edited: 2011-07-03 18:16:13 +0200 (CEST)