aquercus has asked for the wisdom of the Perl Monks concerning the following question:
The testing reports for the approaches listed here (http://search.cpan.org/search?mode=module&query=File%3A%3ATail) do not report success in windows applications.
The environment is ActiveState perl on a windows 7 box. I want to read records into my perl program from a file as they are being written to it by an external program. While windows does not have an internal tail command, MS does provide one as described at this site: ( http://www.windows-commandline.com/2010/08/tail-command-for-windows.html). Upon execution, this works fine except the output from tail goes to a command window and is not capture-able in perl by any means I can develop. I'm seeking an equivalent capability using perl's file IO functions. Thanks;
#! /usr/bin/perl my $cmdtorun = "tail -f D:/prjct/logger/2013-06-05.dlg |"; open(TL, $cmdtorun) || die "Failed: $!\n"; while ( <TL> ) { print "Got: $_\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tail pipe
by kcott (Archbishop) on Jun 20, 2013 at 07:02 UTC | |
by aquercus (Initiate) on Jun 20, 2013 at 17:02 UTC | |
|
Re: tail pipe
by davido (Cardinal) on Jun 19, 2013 at 22:28 UTC | |
|
Re: tail pipe
by NetWallah (Canon) on Jun 20, 2013 at 03:48 UTC | |
|
Re: tail pipe
by BrowserUk (Patriarch) on Jun 20, 2013 at 17:55 UTC | |
|
Re: tail pipe
by Laurent_R (Canon) on Jun 19, 2013 at 21:57 UTC | |
by aquercus (Initiate) on Jun 19, 2013 at 22:28 UTC |