- %months = (
- Jan => 0,
- Feb => 1,
- Mar => 2,
- Apr => 3,
- May => 4,
- Jun => 5,
- Jul => 6,
- Aug => 7,
- Sep => 8,
- Oct => 9,
- Nov => 10,
- Dec => 11,
- );
-
- while(<DATA>){
- ($m,$d,$y,$t) = /(\w+)\s(\d+)\s(\d+)\s(.*)/;
- print "$y-$months{$m}-$d $t\n";
- };
-
- __DATA__
- Dec 23 2011 22:41:46
- Dec 23 2011 22:33:46
- Aug 3 2012 22:41:46
复制代码
|