in reply to Comparing elements in Array of Hashes (AoH)

Show us your code and we will tell you what's wrong with it.
  • Comment on Re: Comparing elements in Array of Hashes (AoH)

Replies are listed 'Best First'.
Re^2: Comparing elements in Array of Hashes (AoH)
by hmadhi (Acolyte) on Jul 18, 2012 at 14:18 UTC
    I have converted to references
    for ( my $i = 0 ; $i <= $#{$aref_current_events} ; $i++ ) { for (my $j = 0 ; $j <= $#{$aref_previous_events} ; $j++ ) { if (( $aref_current_events->[$i]{'node'} eq "$aref_previous_events->[$j]{'node'}" ) && ($aref_current_events->[$i]{'link'} eq "$aref_previous_events->[$j]{'link'}" ) ) { print "$aref_current_events->[$i]{'load'} $aref_current_events->[$ +i]{'load'}\n"; } } }