【问题标题】:What is the best way to read the lines of dynamically generated file in Perl? [closed]在 Perl 中读取动态生成的文件行的最佳方法是什么? [关闭]
【发布时间】:2020-05-18 14:51:27
【问题描述】:

我有一个由第二个动态填充的日志文件。我想读取文件(最新行)并过滤掉是否有任何异常。在 Perl 中读取动态生成的文件行的最佳方法是什么?

【问题讨论】:

  • 文件::尾? . . .
  • 您需要实时检测/反应还是低处理空间?
  • tail -f /path/log/file | egrep "filter1|filter2"?

标签: perl file-handling


【解决方案1】:

请参阅 perlfaq5 中的 How do I do a tail -f in perl?File::Tail

【讨论】:

    猜你喜欢
    • 2010-09-24
    • 1970-01-01
    • 1970-01-01
    • 2011-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-30
    相关资源
    最近更新 更多