#!/usr/bin/perl $string = qqü password=atonic comment=false #This is a motherfucking comment comment=true verbose=0 score=3 #Ignore that shit or it will kill you kill=true user=markus ü; foreach $var (split ("\n",$string)) { next scalar @words print $string; %hash = $string =~ /(\w+)=(\w+)/g; foreach $var (keys (%hash)) { print "Key:$var -> Value:$hash{$var}\n"; }