Leser: 1
8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
open (CMD, "(time $commandline | sed 's/^/STDOUT:/') 2>&1 |");
while (<CMD>) {
if (s/^STDOUT://) {
push @stdout, $_;
}
else {
push @stderr, $_;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
# vi:ts=4 sw=4 et:
use strict;
use warnings;
use vars qw/@stdout @stderr $commandline @time /;
$commandline = 'perl sapr.pl';
open (CMD, "(time $commandline | sed 's/^/STDOUT:/') 2>&1 |");
while (<CMD>) {
if (s/^STDOUT://) {
push @stdout, $_;
}
else {
push @stderr, $_;
}
}
close CMD;
@time = splice(@stderr, -4, 4);
print "@time", $/;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
# vi:ts=4 sw=4 et:
use strict;
use warnings;
use vars qw/@stdout @stderr $commandline @time /;
$commandline = 'perl sapr.pl';
open (CMD, "(time $commandline | sed 's/^/STDOUT:/') 2>&1 |");
while (<CMD>) {
if (s/^STDOUT://) {
push @stdout, $_;
}
else {
push @stderr, $_;
}
}
close CMD;
@time = splice(@stderr, -4, 4);
print "@time", $/;
8 Einträge, 1 Seite |