WaywardBuddha has asked for the wisdom of the Perl Monks concerning the following question:
Line 89 in my proto-code is a simple:Invalid conversion in printf: "%P" at ./systail line 89, <GEN0> line 6 +68899.
The error is actually attached to the line, so it gets passed into the rest of the processing and pretty much wreaks havoc with my regex's etc. Here is a snippet of what I am working with (I changed the actual processing to a simple printf while I am troubleshooting):printf("$line\n");
Does anyone have any experience with tailing multiple files, or has used File::Tail::Multi that can offer some sage-like wisdom? This seems pretty straight forward, but after commenting out the "next if" line and rewriting this a few different ways, I am kind of lost here. Thank you!### Set up the multitail handle for our logfiles $multitail=File::Tail::Multi->new ( Files => ["$logstring"], Debug => "0", Function => \&ProcessLogs, RemoveDuplicate => 0, ); for (;;) { $multitail->read; sleep 4; } exit 0; ### Log Processing Main Routine sub ProcessLogs { my $passed=shift; foreach my $line ( @{$passed} ) { chomp $line; printf("$line\n"); next if $line=~//; if ($line=~/Built/) { printf("Built\n"); } elsif ($line=~/Teardown/) { printf("Teardown\n"); } elsif ($line=~/Deny/) { printf("Deny\n"); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Usage of File::Tail::Multi generates conversion errors
by ikegami (Patriarch) on Nov 18, 2008 at 23:46 UTC | |
|
Re: Usage of File::Tail::Multi generates conversion errors
by gwadej (Chaplain) on Nov 18, 2008 at 23:52 UTC | |
|
Re: Usage of File::Tail::Multi generates conversion errors
by MidLifeXis (Monsignor) on Nov 18, 2008 at 23:21 UTC | |
|
Re: Usage of File::Tail::Multi generates conversion errors
by fmerges (Chaplain) on Nov 18, 2008 at 23:57 UTC | |
by WaywardBuddha (Initiate) on Nov 21, 2008 at 19:23 UTC |