in reply to Re: What does [=;] mean
in thread What does [=;] mean

how does the code know to use the numbers in the scalar as keys for the hash ?

Actually, the numbers are the values.
The array is (GFG, 1, GEEKS, 2, PROGEEK, 3).
The keys will always be the the first, third, fifth, seventh, ... items of the array.
The values will always be the second , fourth, sixth, eighth, ... items, and each of those values will be associated with the key that precedes it.
my %spl = ('GFG', '1', 'GEEKS', '2', 'PROGEEK', '3'); foreach my $key (keys %spl) { print "$key:$spl{$key}\n"; }
Note that the keys are not necessarily printed out in the same order. For a first run, I get:
GEEKS:2 GFG:1 PROGEEK:3
A second run yields:
PROGEEK:3 GEEKS:2 GFG:1
and a third run produces:
GFG:1 GEEKS:2 PROGEEK:3
But the key-value association remains unchanged.

Cheers,
Rob