Not the way you are doing it. This would work, though:
my %_HASH;
%_HASH = (
typeOne => {
root => '/path/to/typeOne',
logfile => $_HASH{typeOne}->{root}.'/logone.log';
},
typeTwo => {
root => '/path/to/typeTwo',
logfile => $_HASH{typeTwo}->{root}.'/logtwo.log';
}
);
On Mon, Aug 11, 2008 at 9:52 AM, Dermot <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am trying to make hash that refers to itself like this
>
> my %_HASH;
> %_HASH = (
> typeOne => {
> root => '/path/to/typeOne',
> logfile => $_HASH{typeOne}->{root}.'/logone.log';
> },
> typeTwo => {
> root => '/path/to/typeTwo',
> logfile => $_HASH{typeTwo}->{root}.'/logtwo.log';
> }
> );
>
>
> But nothing is initialised at this point so $_HASH{typeOne}->{root} is
> an uninitialized value when creating and logfile key.
>
> Is there a way around this?
> TiA,
> Dp.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/