#! perl -slw use strict; use Data::Dumper; my %config; m[^([^#][^=]+)=(.*)$] and $config{ $1 } = $2 while ; print Dumper \%config; __DATA__ THIS=that name=joe height=heyman #this is a comment age=14