3 Einträge, 1 Seite |
my $return = qx{befehl mit allen parametern};
my $return = qx{$programm '$argument'};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
   Here&âs a safe backtick or pipe open for read:
     # add error processing as above
     $pid = open(KID_TO_READ, "-|");
     if ($pid) {  # parent
       while (<KID_TO_READ>) {
         # do something interesting
       }
       close(KID_TO_READ) || warn "kid exited $?";
     } else {    # child
       ($EUID, $EGID) = ($UID, $GID); # suid only
       exec($program, @options, @args)
         || die "can&ât exec program: $!";
       # NOTREACHED
     }
3 Einträge, 1 Seite |