#!/usr/bin/perl -w use strict; my $cached_routers = "C:\\Dokumente und Einstellungen\\ich\\Anwendungsdaten\\tor\\cached-routers"; my ($nickname, $ipaddress, $ORPort, $SOCKSPort, $DirPort, $avg_bandwidth, $burst_bandwidth, $observed_bandwith); open (FILE, "<$cached_routers") or die $!; while (my $line = ) {     if ($line !~ /router/) { next };     if ($line !~ /bandwidth/){ next };    if ( $line =~ /router\s(\w+)\s(\d+\.\d+\.\d+\.\d+)\s(\d+)\s(\d+)\s(\d+)/) {        $nickname = $1;        $ipaddress = $2;        $ORPort = $3;        $SOCKSPort = $4;        $DirPort = $5;        #$NL = $6;        #print "$nickname $ipaddress $ORPort $SOCKSPort $DirPort\n";     }          if ( $line =~ /bandwidth\s(\d+)\s(\d+)\s(\d+)/) {         $avg_bandwidth = $1;         $burst_bandwidth = $2;         $observed_bandwith = $3;     }     open (FILE2, ">>router.txt") or die $!;     print FILE2 "$nickname $ipaddress $avg_bandwidth\n";     close (FILE2); }