use strict; use warnings; # Config-Datei my $config = './webpage_check.cfg'; # Oeffne Datei zum Lesen, bei Fehler brich ab open my $fh, '<', $config or die $!; # Lese jede Zeile ein while( my $line = <$fh> ) { # teile Zeile an Tabulator und nimm die Elemente my ($fqdn) = (split /\t/, $line)[0]; print $fqdn; my ($svc_id) = (split /\t/, $line)[1]; print $svc_id; my ($comment) = (split /\t/, $line)[2]; print $comment; my ($url) = (split /\t/, $line)[3]; print $url; my ($pattern) = (split /\t/, $line)[4]; print $pattern; # uebergib URL an wget my $content = qx{ /usr/sfw/bin/wget -t 2 -T 5 -S -O - $url | grep "$pattern" }; print $content } close $fh;