Thread das boese shell & (14 answers)
Opened by mark05 at 2011-07-03 17:21

mark05
 2011-07-03 18:15
#150103 #150103
User since
2010-01-05
129 Artikel
BenutzerIn
[default_avatar]
hi

sorry ich vergas , ne ich rufe externes via IPC::open3 auf.

Code: (dl )
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)

View full thread das boese shell &