Re: hash key names

2006-01-20 Thread Todd W
"The Ghost" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have keys with periods in them: > > my %hash; > $hash{something.withaperiod}="some text"; > my $something='something'; > my $withaperiod='withaperiod'; > print qq{$hash{"$something.$withaperiod"}\n}; > > > what will it pri

Re: hash key names

2006-01-20 Thread Tom Phoenix
On 1/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > I have keys with periods in them: > > my %hash; > $hash{something.withaperiod}="some text"; > my $something='something'; > my $withaperiod='withaperiod'; > print qq{$hash{"$something.$withaperiod"}\n}; > > > what will it print? What did it print

Re: hash key names

2006-01-20 Thread Brenden Eng
That will produce a bunch of errors. You need to quote the key containing a period in it. Example: $hash{"something.withaperiod"}="some text"; This produces the expected output. On 1/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > > I have keys with periods in them: > > my %hash; > $hash{somethi

Re: hash key names

2006-01-20 Thread Chas Owens
snip > It will print nothing; something.withaperiod is not a bareword. Try > putting it in quotes > > $hash{'something.withaperiod'}="some text"; > Or, more accurately, 'something' and 'withaperiod' are barewords that are getting joined by the '.'. You should really start using the 'use warnings

Re: hash key names

2006-01-20 Thread Chas Owens
On 1/20/06, The Ghost <[EMAIL PROTECTED]> wrote: > I have keys with periods in them: > > my %hash; > $hash{something.withaperiod}="some text"; > my $something='something'; > my $withaperiod='withaperiod'; > print qq{$hash{"$something.$withaperiod"}\n}; > > > what will it print? It will print nothi