J
Jking
hi,
I am reading the perl code of Blosxom,
I can not quite catch the meaning of this expressiong:
%month2num = (nil=>'00', Jan=>'01', Feb=>'02', Mar=>'03', Apr=>'04',
May=>'05', Jun=>'06', Jul=>'07', Aug=>'08', Sep=>'09', Oct=>'10', Nov=>'11',
Dec=>'12');
@num2month = sort { $month2num{$a} <=> $month2num{$b} } keys %month2num;
how does the sort function works with keys?
Anyone can kindly explain it for me Pls?
Justin
I am reading the perl code of Blosxom,
I can not quite catch the meaning of this expressiong:
%month2num = (nil=>'00', Jan=>'01', Feb=>'02', Mar=>'03', Apr=>'04',
May=>'05', Jun=>'06', Jul=>'07', Aug=>'08', Sep=>'09', Oct=>'10', Nov=>'11',
Dec=>'12');
@num2month = sort { $month2num{$a} <=> $month2num{$b} } keys %month2num;
how does the sort function works with keys?
Anyone can kindly explain it for me Pls?
Justin