in reply to Re: Hash key string restrictions?
in thread Hash key string restrictions?
Having said that, though, there is one exception: an empty string will NOT work,...
I am not sure where you got that idea but an empty string works fine:#!/usr/bin/perl use strict; use warnings; my %hash; $hash{''} = 'foo'; print $hash{''};
But I'm still very curious -- how on earth did such a question occur to you?
My guess would be due to a background in another language. Certain C libraries have restriction on hash key length for instance while Java allows you to store objects as hash keys .Cheers - L~R
|
|---|