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

The @columns_import array is not the problem. You are modifying the %column_data_import; hash but always keep the same variable around. Most likely, the line my %column_data_import; must be moved into the loop where the different column data import schedules are held.

Replies are listed 'Best First'.
Re^4: Overwriting Hash / Array
by iRemix94 (Sexton) on Jul 28, 2015 at 08:18 UTC

    If I do that, i have to put the line into the loop aswell:

    push (@columns_import, \%column_data_import);

    this results in a data structure with wrong data in it, as you can see in the Dumper result here:

    { 'IMPORT_VALUE' => '1', 'BGCOLOR_CUSTOMER' => 0, 'SCHEDULE_ROWS' => [ { 'SCHEDULE_COLUMNS_EXPORT' => [ { 'S +CHEDULE' => '20:00', 'U +NDEF' => 1 }, { 'L +INK' => 'CUSTOMERA_DOMAINA_27.07.2015_20_EXPORT.html', 'O +K' => 1, 'S +CHEDULE' => '20:00', 'U +NDEF' => 0 }, { 'L +INK' => 'CUSTOMERA_DOMAINA_26.07.2015_20_EXPORT.html', 'O +K' => 1, 'S +CHEDULE' => '20:00', 'U +NDEF' => 0 }, { 'L +INK' => CUSTOMERA_DOMAINA_25.07.2015_20_EXPORT.html', 'O +K' => 1, 'S +CHEDULE' => '20:00', 'U +NDEF' => 0 }, { 'S +CHEDULE' => '20:00', 'U +NDEF' => 1 }, { 'S +CHEDULE' => '20:00', 'U +NDEF' => 1 }, { 'S +CHEDULE' => '20:00', 'U +NDEF' => 1 } ] }, { 'SCHEDULE_COLUMNS_IMPORT' => [ { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {}, { 'S +CHEDULE' => '23:21', 'U +NDEF' => 1 }, {}, {}, { 'S +CHEDULE' => '23:42', 'U +NDEF' => 1 }, {} ] } ], 'EXPORT_VALUE' => '1', 'DOMAIN' => 'DOMAINA', 'CUSTOMER' => 'CUSTOMERA' },