#!/usr/bin/perl -w #Markus Westphal 09.01.2006 ###################################################### # Markus Westphal blocks.pl # ###################################################### use strict; my($pf,$j,$i,$datei,@alles,%links); $i = 1; #globale Variabeln füllen $datei = "a-haem-blocks.txt"; $i = 0; #EINLESEN Dateinamen Profile for($j = -1; $j < $#ARGV; $j++) { if($ARGV[$j] =~ /^datei/) { ($pf, $datei) = split("=", $ARGV[$j]); } } #AUSGABEDATEI open(TF, ">blockserg.txt") || die ("Die Ausgabedatei kann nicht erstellt werden!\n"); #EINLESEN open(DT,"<$datei") || die ("$datei kann nicht geoeffnet werden!"); while(
) { if($_ =~ /^HBA/) { &zcheck($_); } if($_ =~ /^Q/) { &zcheck($_); } } close(DT); &ausgabe(); #FUNKTIONEN sub zcheck() { my($c) = @_; my($index); $c =~ /(.*) \(\s+\d+\).*/; $index = $1; if(!defined($links{$index})) { $links{$index} = 1; } else { $links{$index}++; } } sub ausgabe() { foreach(keys %links) { if($links{$_} == 5) { print TF "$_\n"; } else { print "$_ = $links{$_}\n"; } } } close(TF);