[ale] perl question

Chris Fowler cfowler at outpostsentinel.com
Tue Apr 27 13:45:26 EDT 2004


I'm having an issue accessing an array I'm storing in a object.

What I'm trying to do is add a hash entry to an array of hashes that are
in this class.  I can not seem to figure out how to get the count.  Can
someone point out what I'm doing wrong?
 

sub new {
  my $class =shift;

  my ($alarm_id,
      $raised,
      $trigger,
      $ensname,
      $locid,
      $locname,
      $notgroup
  ) = @_;

  my $data = {
      'alarm.alarm_id'        => $alarm_id,
      'alarm.raised'          => $raised,
      'alarm.trigger_match'   => $trigger,
      'ens.name'              => $ensname,
      'location.location_id'  => $locid,
      'location.name'         => $locname,
      'notification_group.notification_group_id' => $notgroup,

      #
      # A notification group can have (n) number
      # of escalation groups.  I will store them here
      # as an array of hashes
      #
      'esclationgroups'       => []
  };
  bless($data, $class);
  return $data;
}

sub add_escalation_group {
  my $self = shift;
  my $esc = \$self->{'escalationgroups'};
  my @g = @{$esc};
  my($id, $timeout) = @_;

  #
  # I need to determine the number of objects
  # in the array so I can append to it.
  #



}




More information about the Ale mailing list