gpt4 book ai didi

perl - 如何在 Perl 中打印源代码行号?

转载 作者:行者123 更新时间:2023-12-02 03:31:00 25 4
gpt4 key购买 nike

是否可以在 Perl 中获取当前源代码行号?C++ 中的等效项是 __LINE__

最佳答案

__LINE__ 文字记录在 Special Literalsperldata man page 部分.

print "File: ", __FILE__, " Line: ", __LINE__, "\n";

warn("foo");

关于perl - 如何在 Perl 中打印源代码行号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/355456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com