#!/usr/bin/perl use strict; use warnings; my $fix = 'abcdefg'; my $new = 'abcdgrf'; my %fhash; my $count; for (split //, $fix) { $count ++; $fhash{$_} = $count; } $count = 0; my $errcount; for my $char (split //, $new) { $count ++; if (!$fhash{$char}) { print "Zusaetzliches Zeichen: $char\n"; $errcount ++; } elsif ($fhash{$char} != $count) { print "Zeichen an Pos. $count statt an Pos. $fhash{$char}: $char\n"; $errcount ++; } } print "Anzahl Fehler: $errcount" if $errcount;