in reply to Re^3: Overwriting Hash / Array
in thread Overwriting Hash / Array

my wished structure is like the dumper result in my original post. As you can see there, the SCHEDULE_COLUMNS_IMPORT has several entries. The schedule value here should display the value of $imp_formated_hour from all the existing export reports. So it should basically be the same as the SCHEDULE_COLUMNS_EXPORT, just with other schedule_values. The difference here is, the schedule value for the export reports are gathered in a loop before. Not like the schedule values of the import reports. I don't know how I can change my code so that it doesn't overwrite the hash all the time .. sorry, my PERL knowledge is still very lacking :/

Replies are listed 'Best First'.
Re^5: Overwriting Hash / Array
by poj (Abbot) on Jul 28, 2015 at 11:49 UTC
    Are the import times held like this and if so how do they relate to variable $scheduled_export_days ?.
    #!perl use strict; use Data::Dump 'pp'; my $bi->{customer}{domain}{host}{BACKUPDATA}=[ { ENDDATE_SEC => 1 }, { ENDDATE_SEC => 2 }, { ENDDATE_SEC => 3 }, { ENDDATE_SEC => 4 }, { ENDDATE_SEC => 5 }, ]; pp $bi; for my $act (@{$bi->{customer}->{domain}->{host}->{BACKUPDATA}}){ print $act->{ENDDATE_SEC}."\n"; }
    poj

      Yes, that's how the import times are held. Basically, the import start time is the export finish time. As soon as the export finished, the import starts.

      The variable $scheduled_export_days tells, how many different import / export are stored. It can be max 7, 1 for each day. If its value is e.g 5, than there are export reports for the last 5 days. I need it, because I have to write GUI-Monitor, which displays the last 7 days and the fitting import / export report for each day.

      I hope this information helps you out!

        For the Exports, I can see you are iterating through $act records matching the STARTDATE_SEC to the corresponding schedule time (within 30 mins) for each of the scheduled export days.

        Why are you not doing the same for the Imports ?

        poj