Embperl 中 %mdat(与 %udat 相比)的用途是什么?
我看到会话处理提到了 %mdat
以及 %udat
哈希。有什么区别以及何时以及为何使用 %mdat
哈希?
I saw that session handling mentioned an %mdat
as well as %udat
hash. What is the difference and when and why would I use the %mdat
hash?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 Embperl POD 中所述,
另外,请注意,上面 POD 中的“您将会看到”措辞有些误导性,这可能会导致您感到困惑。
主要 Embperl 文档提供了更多信息消除混乱的精确答案:
请注意我以粗体突出显示的文本 - 任何用户。典型的会话数据(存储在
%udat
中)仅特定用户存储和访问。因此,
%mdat
充当一种基于每个 embperl 页面但与用户无关的数据存储。要回答您的“何时”问题,在实践中使用
%mdat
的一个示例是每页访问计数器。As noted in Embperl POD,
Also, please note that the "you will see" wording in POD above is somewhat misleading, which may have contributed to your confusion.
The main Embperl documentation provides a more precise answer that removes the confusion:
Please note the text I highlighted in bold - any user. Typical session data (as stored in
%udat
) is only stored and accessible for a specific user.Therefore,
%mdat
acts as a sort of per-individual-embperl-page but user-independent data store.To answer your "when" question, an example of using
%mdat
in practice would be per-page visit counter.