$test_hash_ref = { 'apple' => 'red', 'junk' => 'foo^bar', 'junk2' => undef, 'lime' => 'green' }; Use of uninitialized value in substitution (s///) at ./serialize.pl line 19. Use of uninitialized value in join or string at ./serialize.pl line 19. apple|red|junk|foo^1bar|junk2||lime|green $test_hash_ref = { 'apple' => 'red', 'junk' => 'foo^bar', 'lime' => 'green', 'junk2' => '' };