[Nottingham] perl question

tim at inspiration7.co.uk tim at inspiration7.co.uk
Fri Sep 15 13:51:19 BST 2006


Easier to read version:

my $key = join '|',($channelX,$pathtype);

my $my_hash_ref = $trailsByChannel{$key};

$my_hash_ref->{$cctName} = 1;


Tim

> Phil
>
>> my (%trailsByChannel);
>>
>> my($channelX,$pathtype,$cctName);
>>
>> $trailsByChannel{join '|',($channelX,$pathtype)}->{$cctName} = 1;
>>
>> The problem I have is that I dont understand what the
>> $trailsByChannel{join '|',($channelX,$pathtype)}->{$cctName} = 1; is
>> doing.
>>
>> Anybody have any ideas have any ideas ?
>
> It looks like trailsByChannel is a hash where the key is a string like
> "foo|bar" where foo is the $channelX and bar is the $pathtype. The data
> value in the hash is a hash reference, where the key is $cctName and the
> data value is 1.
>
> eg.
> {
>            'foo|bar' => {
>                           'baz' => 1
>                         }
>          };
>
>
>
> -Cam
>
> --
> camilo at mesias.co.uk                                                 <--
>
> _______________________________________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/nottingham
>





More information about the Nottingham mailing list