Hallo,
$table->SetRow([ ('STRING(255)') x scalar @columns ],@columns [ ($importerfmt) x scalar @columns ]);
Der Funktionsaufruf oben erzeugt ein "out of memory", der unten nicht. Das ist aber nicht das Problem.
$table->SetRow([ ('STRING(255)') x scalar @columns ],@columns,[ ($importerfmt) x scalar @columns ]);
Ist ja auch etwas voellig anderes :)
Im oberen Funktionsaufruf fehlt die hinter @columns das Komma. Eigentlich
hätte der Compiler das anmeckern müssen.
Warum?
Hat er aber nicht. Ich hab noch nicht ganz verstanden, was der Compiler da
reininterpretiert hat.
Fuer den Interpreter(!) ist
@columns [($importerfmt) x scalar @columns])
dasselbe wie
(@columns[($importerfmt) x scalar @columns])
Will heissen, du erstellst damit eine Liste von Referenzen auf Skalare.
perl -e "print(1,2,3)"
123
Eine normale Liste.
perl -e "print([1,2,3][4,5,6])"
syntax error at -e line 1, near "]["
Klar. Man kann eine Referenz nicht einfach so splicen.
Execution of -e aborted due to compilation errors.
perl -e "print( [1,2,3] [4,5,6] )"
syntax error at -e line 1, near "] ["
Dito.
Execution of -e aborted due to compilation errors.
perl -e "my @a=(1,2,3); print( @a [4,5,6] )"
SCALAR(0x1a7f180)SCALAR(0x1a7f198)SCALAR(0x1a7f1a4)
ist dasselbe wie:
print $a[4],$a[5],$a[6];
perl -e "my @a=(1,2,3); print( @a [4,5,6,7] )"
SCALAR(0x1a7f180)SCALAR(0x1a7f198)SCALAR(0x1a7f1a4)SCALAR(0x1a7517c)
Siehe oben.
Gruesse,
CK