> Can someone explain how to access $InstDesc?? Also please 
> explain how I would access (that is read from or write to) 
> to the $Severity scalar on the bottom structure..

> Thanks in advance.. flk 

Sure I can help. (or guide you astray)

#!/usr/bin/perl
use strict;
use warnings;
my %PlcyActions = (
        START => {
                SEVRTY  => "Start SEV",
                TEXT    => "Start TEXT",
                AUTACTS => "Start AUTACTS"
        },
         CONT => {
                SEVRTY  => "Cont SEV",
                TEXT    => "Cont TEXT",
                AUTACTS => "Cont AUTACTS"
        },
        END => {
                SEVRTY  => "END SEV",
                TEXT    => "END TEXT",
                AUTACTS => "END AUTACTS"
        },
);

my %Instance = (
        CONDITION_1 => {
                DESCRPT => "Conditions descr",
                ACTIONS => \%PlcyActions
        },
);

my $Policy = {
        NAME => "Policy Name",
        DESCRPT => "Policy Descr", 
        INSTNCE => \%Instance 
};

my $testInst = $Policy->{INSTNCE};
my $condition = $testInst->{CONDITION_1};
print $condition->{DESCRPT} . "\n";

my $action = $condition->{ACTIONS};
print $action->{END}->{TEXT} . "\n";

$action->{END}->{TEXT} = "NEW END TEXT";
print $action->{END}->{TEXT} . "\n";

## END

It's worth noting, this type of data structure is likely to get hard to manage 
real
fast. (IMO).  Without knowing your end goal, my knee jerk reaction to seeing 
code like
this would be to recommend a database to maintain relationships.  Other 
opinions and
approaches may vary.

HTH

--
Ronald Weidner



**********************************************************************
This e-mail is intended solely for the intended recipient or recipients. If 
this e-mail is addressed to you in error or you otherwise receive this e-mail 
in error, please advise the sender, do not read, print, forward or save this 
e-mail, and promptly delete and destroy all copies of this e-mail. 
This email may contain information that is confidential, proprietary or secret 
and should be treated as confidential by all recipients. This e-mail may also 
be a confidential attorney-client communication, contain attorney work product, 
or otherwise be privileged and exempt from disclosure. If there is a 
confidentiality or non-disclosure agreement or protective order covering any 
information contained in this e-mail, such information shall be treated as 
confidential and subject to restriction on disclosure and use in accordance 
with such agreement or order, and this notice shall constitute identification, 
labeling or marking of such information as confidential, proprietary or secret 
in accordance with such agreement or order.
The term 'this e-mail' includes any and all attachments.
**********************************************************************

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to