You must use arrayref to make a key value an array:

ssh => [eth0,...]

you can make the keys hash ref also:

 %HoH = (
     machine-name => { ssh => {eth0 => ,eth1 => ,eth0 =>,eth0 =>},  },
);

and use exists. Or write a compare sub, for every key of the arrayref...


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf
> Of Williams, P. Lane
> Sent: Wednesday, February 26, 2003 5:20 PM
> To: [EMAIL PROTECTED]
> Subject: [Perl-unix-users] Hash of Hash Perl Questions.....
>
>
> I am trying to write a PERL app that will look at the messages logfile and
> weed out the firewall messages.  Then build a pretty daily
> report.  I first
> grep what I am looking for into an array.  Then I feed that
> information into
> a hash formatted with the variable that I want....(below).  Once I have it
> all in the hash I can build pretty reports.
> Reporting isn't the problem and getting the information isn't the
> problem......it's the array portion of the hash.
>
> I am trying to produce a Hash of Hash where the value portion will be an
> array.  The array portion would look like this
> (eth0,etho,etho,eth1,eth0).
>
> What I would realy like to do would be able to have only one accurance of
> each value with a counter value attached...such as (eth0x4,eth1x1).
>
> This is what the hash looks like..basically...
> %HoH = (
>     machine-name => {
>          ssh => (eth0,eth1,eth0,eth0),
>          telnet => (eth0,eth1,eth0,eth0),
>          icmp => (eth0,eth1,eth0,eth0),
>        },
>     machine-name2 => {
>          ssh => (eth0,eth1,eth0,eth0),
>          telnet => (eth0,eth1,eth0,eth0),
>          icmp => (eth0,eth1,eth0,eth0),
>        },
>   );
>
> This is what I would like it to look like........
> %HoH = (
>     machine-name => {
>          ssh => (eth0x3,eth1x1),
>          telnet => (eth0x3,eth1x1),
>          icmp => (eth0x3,eth1x1),
>        },
>     machine-name2 => {
>          ssh => (eth0x3,eth1x1),
>          telnet => (eth0x3,eth1x1),
>          icmp => (eth0x3,eth1x1),
>        },
>   );
>
> Anyone have any basic pointers of how to handle the array portion??  I am
> thinking I will need to include a subroutine that will do the job.
>
> Thanks for any help,
>
> Lane
>
>
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to