"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
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
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
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
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