#!/usr/bin/perl $something{'that\'s it'} = "foo"; $something{'thats it\!'} = "bar"; use Data::Dumper; print Dumper \%something; __END__ $VAR1 = { 'that\'s it' => 'foo', 'thats it\\!' => 'bar' };