J'ai un script Perl qui exécute un script python mais j'ai besoin de renvoyer des informations au script Perl. Quelqu'un peut-il m'aider à y parvenir?Exécuter un programme et capturer sa sortie
C'est mon code jusqu'à présent
open(my $py, "|-", "python2 /home/pi/myRead.py") or die "Cannot run Python script: $!";
while (<$py>) {
$newCard = $py;
}
close($py);
Vous gardez '$ newCard' écraser au lieu d'ajouter à ce – ikegami
https://stackoverflow.com/questions/10765311/how-to-read- to-and-write-from-a-pipe-in-perl –
'" - | "' est à lire. –