I had got a script in Perl and my task is to do some changes in it. This of course means to understand which part does exactly what. I am not familiar with Perl language but I tried to read through some tutorials, but still some things are confusing me. And I got stuck in following part:
while (<KOEFICIENTYfile>) {
@_=(split(/\s+/, $_));
push(@ZAID,shift(@_));
$KOEFICIENTY{$ZAID[-1]}=[@_];
}
As I understands this part then it:
- Reads line from filehandle
KOEFICIENTYfile - Separates them by spaces (one or more)
- Loads first item from this separated array into array
ZAID(and in the process, removes it from@_) - ??? Adds a rest of a separated array into array
KOEFICIENTY? I am confused by curly brackets part and by square brackets after equals sign.
I think that I understood the meaning of @, $, @_ or negative indexing but this is beyond me. Can you please advice me on meaning of this?
Data:Dumper. Anyway, thank you all.