I'm learning Perl. Could someone explain this Dbman's default.cfg (aka db.cfg) code fragment to me? It's located near the very end of the default.cfg module of Dbman.
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) { ...<action>...
I'm particularly clueless about the function of the "{ $db_def{$a}[0] <=> $db_def{$b}[0] }" portion. How are {$a} and {$b} used?
Thanks. Jim
PS: db_def is an associative array:
%db_def = (
'f00' => [ 0, 'alpha', 30, 30, 0, '', '', 'owners email' ],
'f01' => [ 1, 'alpha', -2, 10, 0, '', '', 'not used' ]
);
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) { ...<action>...
I'm particularly clueless about the function of the "{ $db_def{$a}[0] <=> $db_def{$b}[0] }" portion. How are {$a} and {$b} used?
Thanks. Jim
PS: db_def is an associative array:
%db_def = (
'f00' => [ 0, 'alpha', 30, 30, 0, '', '', 'owners email' ],
'f01' => [ 1, 'alpha', -2, 10, 0, '', '', 'not used' ]
);

