#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash; while () { s/,/\./g; $hash{$1} = $2 if m/^(\w+)\s=\s(.*)$/; } print $hash{Wert1} - $hash{Wert2}, "\n"; print Dumper \%hash; exit; _ _DATA_ _ Wert1 = 1350,00 Wert2 = 216,00