in reply to Non-fixed data in record

Uhh... why not just make a hash of hashes of hashes. The outer hash's key would be 'PCSPLMNCallDataRecord'. The middle hash's key would be 'mSTerminating'. The inner hash's keys would be, for example, 'radioChannelProperty' and its value would be "00'H".

To load it, you'd have:

my %data; $data{PCSPLMNCallDataRecord}{mSTerminating}{radioChannelProperty} = "00'H";
To access it, you'd have:
my $value = $data{PCSPLMNCallDataRecord}{mSTerminating}{radioChannelPr +operty};

------
We are the carpenters and bricklayers of the Information Age.

Vote paco for President!

Replies are listed 'Best First'.
Re: Re: Non-fixed data in record
by brassmon_k (Sexton) on Aug 31, 2001 at 21:22 UTC
    Yes,

    That's good but here's why I can't give any of the keys a value after the "mSTerminating" line. Okay but let's say the line I want to print can have a possibility of 3 different values.

    So let's say the line you used "radioChannelProperty" can have 3 different values. Would I then constuct like this:
    my %data; $data{PCSPLMNCallDataRecord}{mSTerminating} {radioChannelProperty} = "00'H"; {radioChannelProperty} = "01'H"; {radioChannelProperty} = "02'H";
    The Brassmon_k
      Nope. You would do something like the following:
      my %data; @{$data{PCSPLMNCallDataRecord}{mSTerminating}{radioChannelProperty}} = ("00'H", "01'H", "02'H");
      And access it just like you would any array. Just the name is a little longer. :)

      ------
      We are the carpenters and bricklayers of the Information Age.

      Vote paco for President!

        Okay,

        As if you haven't noticed I'm not to good at the hash/array thing. I'm not a newbie though. I'd say I'm intermediate. Anyway okay again for "radioChannelProperty", If I wanted to print this "radioChannelProperty is at Sector 47" for radioChannelProperty's value of 00'H
        I'd have to do this -
        if (radioChannelProperty[0] =~ "00'H") { print "radioChannelProperty is at Sector 47\n";
        However let's say the above worked. How would I tell the script to find that line in the block of text.
        if ($_ =~ /radioChannelProperty/) {
        Oh, I'm lost on this one.

        The Brassmon_k