perl - File::Temp pass system command output to temp file -


i'm trying capture output of tail command temp file.

here sample of apache access log

here have tried far.

#!/usr/bin/perl use strict; use warnings; use file::temp (); use file::temp qw/ :seekable /;  chomp($tail = `tail access.log`);  $tmp = file::temp->new( unlink => 0, suffix => '.dat' ); print $tmp "some data\n"; print "filename $tmp\n"; 

i'm not sure how can go passing output of $tail temporoy file.

thanks

i use different approach tailing file. have file::tail, think simplify things.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -