【发布时间】:2013-05-26 07:47:17
【问题描述】:
我从 RabbitMQ 队列中读取的数据具有以下值:epoch, id, wait, length, max。我想将此信息放入哈希哈希中。在 Perl 中我会这样做:
%hash = ( $spid => { $epoch => { 'wait' => $wait, 'length' => $length, 'max' => $max } } );
This thread 似乎很接近,但我要么不理解回复,要么不是我想要的。在学习如何在 Ruby 中执行此操作时,我们将不胜感激。
【问题讨论】:
-
不太确定,你想要什么。你的输入数据是什么?它看起来怎么样?
-
这取决于您给定的数据的外观。你能提供你得到的吗?