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
Post a Comment