in reply to regex substitution

closer to what you want..
$text =~ s/#([^#]+)#/$hash{$1}/g
Rich