取消链接 File::Temp 文件的更清晰方法?
我目前正在这样做
my $tmpf = File::Temp->new;
$tmpf->unlink_on_destroy(1);
,但看起来这可能更干净..类似
my $tmpf = File::Temp->new({unlink => 1});
后者可能吗?
I'm currently doing this
my $tmpf = File::Temp->new;
$tmpf->unlink_on_destroy(1);
but it seems like this could be cleaner.. something like
my $tmpf = File::Temp->new({unlink => 1});
is something like the latter possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也可以在构造函数中设置此标志:
但这是不必要的。来自 perldoc File::Temp:
You can also set this flag in the constructor:
But it is unnecessary. From the perldoc File::Temp: