Thread Perl mit Kommandozeilenprogramm kommunizieren (Windows) (79 answers)
Opened by bianca at 2013-09-10 13:07

GwenDragon
 2013-09-12 20:09
#170172 #170172
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use 5.010;
use strict;
use warnings;

use IPC::Cmd qw[can_run run run_forked QUOTE];
my $p=can_run('gpg');
run( 
        command => $p . ' --list-keys test@gwendragon',
        buffer=>\my $buffer
);
say $buffer;


ergibt bei mir die Ausgabe:
C:\>ipc.pl
pub 2048R/118D83B6 2013-09-11 [verfõllt: 2013-09-16]
uid test@gwendragon.de (kein Passwort) <test@gwendragon.de>
sub 2048R/0585C86F 2013-09-11 [verfõllt: 2013-09-16]


Geht doch.

//EDIT
Und selbst das geht, wenn Leerzeichen im Pfad:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

use 5.010;
use strict;
use warnings;

use IPC::Cmd qw[can_run run run_forked QUOTE];
#my $p=can_run('gpg2');
my $p = QUOTE . 'C:\Program Files (x86)\GNU\GnuPG\pub\gpg2.exe' . QUOTE;
run( 
        command => $p . ' --list-keys test@gwendragon',
        buffer=>\my $buffer
);
say $buffer;

Last edited: 2013-09-12 20:20:59 +0200 (CEST)
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread Perl mit Kommandozeilenprogramm kommunizieren (Windows)