Autor Beitrag
bo_91
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 43

Win XP - Win8
C#, PHP, VB, Java
BeitragVerfasst: Di 12.05.09 20:53 
Hallo Leute,

Kann jemand von euch perl?

Ich suche nach der möglichkeit das Output von System direkt zeile für zeile in ein array zu bringen... klappt irgendwie nicht...

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
$messages;
my $pipe;
$command = "cat /var/log/messages | grep \"kernel\"";

open $pipe, system("$command |") or die "FEHLER";

while (<$pipe>){
    push @messages, $_;
}


Resultat:
~ perl log.pl
# sh: -c: line1: syntax error: unexpected end of file
# FEHLER at log.pl line 9 -> line mit open $pipe.....

ich verstehe nicht was falsch ist... dh ich kann eig. kein auch kein perl... bitte dringenst um hilfe