Hi Jim,
On Fri, Jan 11, 2013 at 1:54 PM, Jim Gibson jimsgib...@gmail.com wrote:
OR
print_path( $id, $routes-{$id} );
...
sub print_path
{
...
while( my ($start, $end) = each %$edges ) {
This is what i want, thank you!
Apparently passing $routes-{$id} is my earlier issue.
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
ROUTE-252 = {
# src = dest
427 = ABEP,
ABEP = 441,
441 = 427,
427 = 444,
444 = MGWQ,
MGWQ = CDEF
},
ROUTE-432 = {
AAA = BBB,
On Thu, 10 Jan 2013 17:01:43 +0700
budi perl budipe...@gmail.com wrote:
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
ROUTE-252 = {
# src = dest
427 = ABEP,
ABEP = 441,
441 = 427,
427 = 444,
On Thu, Jan 10, 2013 at 5:19 PM, David Precious dav...@preshweb.co.ukwrote:
On Thu, 10 Jan 2013 17:01:43 +0700
budi perl budipe...@gmail.com wrote:
You can't have the same hash key twice; you've duplicated 427 there.
Also, you don't need to quote the left side of a fat comma, so you can
On 10/01/2013 10:01, budi perl wrote:
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
ROUTE-252 = {
# src = dest
427 = ABEP,
ABEP = 441,
441 = 427,
427 = 444,
444 = MGWQ,
MGWQ = CDEF
Hi Rob,
This works and looks much more simpler. Thanks, i love it.
--budhi
On Fri, Jan 11, 2013 at 1:00 AM, Rob Dixon rob.di...@gmx.com wrote:
On 10/01/2013 10:01, budi perl wrote:
Hi,
I have this following hash:
#!/usr/bin/perl
#
use strict;
use Data::Dumper;
my %MYROUTES = (
Hi All,
I would like to pass hash: %{$routes{ROUTE-252}} instead of %routes but
got this error:
[budi@dev bin]$ ./print_path.pl
Type of arg 1 to each must be hash (not hash element) at
./print_path.plline 38, near })
Execution of ./print_path.pl aborted due to compilation errors.
#use
On Fri, 11 Jan 2013 10:33:02 +0700
budi pearl budipe...@gmail.com wrote:
my $id = ROUTE-252;
print Dumper $routes{$id};
print_path($id, \%{$routes{$id}});
I think you want:
print_path( $id, $routes{$id} );
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail:
Hi Shawn,
When trying to accessed inside subroutine , i got:
Type of arg 1 to each must be hash (not hash element) at
./print_path.plline 41, near })
Execution of ./print_path.pl aborted due to compilation errors.
this is work:
while (my ($start, $end) = each %{$routes{$label}}) {
but this
On Fri, Jan 11, 2013 at 11:05 AM, budi pearl budipe...@gmail.com wrote:
Hi Shawn,
When trying to accessed inside subroutine , i got:
Type of arg 1 to each must be hash (not hash element) at ./print_path.plline
41, near })
Execution of ./print_path.pl aborted due to compilation errors.
On Jan 10, 2013, at 7:33 PM, budi pearl wrote:
Hi All,
I would like to pass hash: %{$routes{ROUTE-252}} instead of %routes but
got this error:
[budi@dev bin]$ ./print_path.pl
Type of arg 1 to each must be hash (not hash element) at
./print_path.plline 38, near })
Execution of
Sorry about being tricky with what was an older thread. But I suspect
that thread died... and no one noticed there was an unaswered question
still there.
Shawn C originally suggested I use File::Tail. There was a short
exchange about why and then I began trying to use File::Tail but
haven't
At 3:57 PM -0500 10/24/09, Harry Putnam wrote:
Sorry about being tricky with what was an older thread. But I suspect
that thread died... and no one noticed there was an unaswered question
still there.
Or no one knew the answer.
Shawn C originally suggested I use File::Tail
(untested):
while(1) {
while(FILE) {
print;
}
sleep 1;
seek(FILE,0,1);
}
That does look like it might be better... and thanks for the explanation.
[...]
use File::Tail;
$file=File::Tail-new(/some/log/file);
while (defined($line=$file-read)) {
print
.
In this case, the above code is a kludge. You can tell this because the
program sleeps, rather than waiting on input. When a program does
something to emulate what it really should be doing, it introduces code
that may not work in all cases.
I'm having trouble with File::Tail... or more likely
Harry Putnam wrote:
Shawn H Corey shawnhco...@gmail.com writes:
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm
Thanks that looks useful. Is there a reason why I should use that
module as apposed to the kind of code offered in the faq about
tail? (perldoc -q tail
On Mon, 19 Oct 2009 23:30:30 -0500, Harry Putnam wrote:
Shawn H Corey shawnhco...@gmail.com writes:
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm
Thanks that looks useful. Is there a reason why I should use that
module as apposed to the kind of code offered in the faq about
restart system logger.
Now anything that sys logger produces will be displayed from the cat
command.
Now restart systemlogger again and cat closes as would a common
shell script or awk.
However the `tail -f' command will not close... it keeps on reading
through restarts.
I want to get
Harry Putnam wrote:
I'm not sure what it is about the tail -f command that allows it to
keep reading over restarts of system logger (on Opensolaris)... but
how can I emulate whatever it is.. in perl?
Have you looked at File::Tail
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm
On 10/19/09 Mon Oct 19, 2009 11:38 AM, Harry Putnam rea...@newsguy.com
scribbled:
I'm not sure what it is about the tail -f command that allows it to
keep reading over restarts of system logger (on Opensolaris)... but
how can I emulate whatever it is.. in perl?
There is an FAQ
Jim Gibson jimsgib...@gmail.com writes:
On 10/19/09 Mon Oct 19, 2009 11:38 AM, Harry Putnam rea...@newsguy.com
scribbled:
I'm not sure what it is about the tail -f command that allows it to
keep reading over restarts of system logger (on Opensolaris)... but
how can I emulate whatever
叶孤城 gucheng...@freenet.de writes:
2009/9/27 叶孤城 gucheng...@freenet.de:
2009/9/27 Harry Putnam rea...@newsguy.com:
Will it make any difference in loading time or cpu resource usage to
use the `tail' command like 'qx/tail -n30 $file/' as apposed to something
in straight perl like this example
Will it make any difference in loading time or cpu resource usage to
use the `tail' command like 'qx/tail -n30 $file/' as apposed to something
in straight perl like this example that prints the last 30 lines of $log:
#!/usr/local/bin/perl
use strict;
use warnings;
my $log = shift
2009/9/27 Harry Putnam rea...@newsguy.com:
Will it make any difference in loading time or cpu resource usage to
use the `tail' command like 'qx/tail -n30 $file/' as apposed to something
in straight perl like this example that prints the last 30 lines of $log:
Not absolute that which is better
2009/9/27 叶孤城 gucheng...@freenet.de:
2009/9/27 Harry Putnam rea...@newsguy.com:
Will it make any difference in loading time or cpu resource usage to
use the `tail' command like 'qx/tail -n30 $file/' as apposed to something
in straight perl like this example that prints the last 30 lines
From: Chas. Owens
On Mon, Mar 23, 2009 at 14:16, Amit Saxena learn.tech...@gmail.com
wrote:
Is it possible to implement this without using any external modules
from
CPAN ?
The FAQ covers this quite nicely (see below). In general you should
use File::Tail[1]. And on UNIX systems, of course
On Tue, Mar 24, 2009 at 10:26, Bob McConnell r...@cbord.com wrote:
snip
As a result, installing a new module on the production server is very
expensive. It must go through our code review and QA testing as well as
being repackaged in the correct format for deployment. It is difficult
to
Is it possible to implement this without using any external modules from
CPAN ?
Thanks Regards,
Amit Saxena
Amit == Amit Saxena learn.tech...@gmail.com writes:
Amit Is it possible to implement this without using any external modules from
Amit CPAN ?
Is it possible? Yes. Reasonable? No.
Please state clearly your confusion about being able to include CPAN modules
in your workflow. Hint: none of the
On Mon, Mar 23, 2009 at 14:16, Amit Saxena learn.tech...@gmail.com wrote:
Is it possible to implement this without using any external modules from
CPAN ?
Thanks Regards,
Amit Saxena
The FAQ covers this quite nicely (see below). In general you should
use File::Tail[1]. And on UNIX systems
wanted to do
my $top = `head -1 $source`
my $bottom = `tail -1 $source`
but I realized I cannot do $source in back tick.
so I imagine i can do
my $top = chop $source;
But what about the $bottom one?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
below command )
and I wanted to do
my $top = `head -1 $source`
my $bottom = `tail -1 $source`
but I realized I cannot do $source in back tick.
so I imagine i can do
my $top = chop $source;
But what about the $bottom one?
The chop() function simply removes the last character from
i need to issue below command )
and I wanted to do
my $top = `head -1 $source`
my $bottom = `tail -1 $source`
but I realized I cannot do $source in back tick.
so I imagine i can do
my $top = chop $source;
But what about the $bottom one?
The chop() function simply removes the last
some other stuff
before i need to issue below command )
and I wanted to do
my $top = `head -1 $source`
my $bottom = `tail -1 $source`
but I realized I cannot do $source in back tick.
so I imagine i can do
my $top = chop $source;
But what about the $bottom one?
The chop
Rob Dixon wrote:
Richard Lee wrote:
when you are doing it to filehandle vs array, which consumes more
memory?
my source file is about 100,000 lines...
open my $source, 'tmp/server.txt' or die !$;
VS tie my @file, 'Tie::File', '/tmp/server.txt' or die $!;
Neither of them use any
Hi Guys,
I have used the following code to print the log files. but nothing is
printed even it doesn't show the warning message, no prompt is
returned.
what is the mistake in code , could u help me to find the pbm???
#!/usr/bin/perl
use strict;
use warnings;
use File::Tail;
my $file=File
is the mistake in code , could u help me to find the pbm???
#!/usr/bin/perl
use strict;
use warnings;
use File::Tail;
my $file=File::Tail-new(/some/log/file/path);
while (defined(my $line=$file-read))
{
print $line;
}
Thanks,
Siva
--
To unsubscribe, e-mail: [EMAIL PROTECTED
File::Tail is waiting at least 10 second before starting to work.
if it is taking at least 10 second to start then how it is faster than
using open to access the file???
On Wed, 2007-08-29 at 11:49 +0200, Angerstein wrote:
File::Tail is waiting at least 10 second before starting to work
the following code to print the log files. but nothing is
printed even it doesn't show the warning message, no prompt is
returned.
what is the mistake in code , could u help me to find the pbm???
#!/usr/bin/perl
use strict;
use warnings;
use File::Tail;
my $file=File::Tail-new(/some
sivasakthi wrote:
I have used the following code to print the log files. but nothing is
printed even it doesn't show the warning message, no prompt is
returned. what is the mistake in code , could u help me to find the
pbm???
#!/usr/bin/perl
use strict;
use warnings;
use File::Tail;
my
warnings;
use File::Tail;
my $file=File::Tail-new(/some/log/file/path);
while (defined(my $line=$file-read))
{
print $line;
}
Thanks,
Siva
It works for me.
Maybe you want to change one of the intervals or timeouts for
File::Tail. It could be that your log file is updated infrequently
File::Tail will read only lines that are added to the file after it has been
opened. Your program will simply sleep until something new is added.
Rob
when my log file is updated then it works correctly
thanks to all for reply
with no buffering at all you use syswrite and only
write 1 char at a time.)
-Ursprüngliche Nachricht-
Von: sivasakthi [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 29. August 2007 12:13
An: Jeff Pang
Cc: beginners perl
Betreff: Re: Problem in opening the file using Tail Module
i didn't get your point
rtfm ^^
-Ursprüngliche Nachricht-
Von: sivasakthi [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 29. August 2007 13:16
An: beginners perl
Betreff: Re: Problem in opening the file using Tail Module
File::Tail will read only lines that are added to the file after it
has been opened
at first it might make more sense to write the backend
part of my script in PHP, but PHP lacks
http://search.cpan.org/dist/File-Tail/Tail.pm which I'd like to use for
continuous screening of a spool file.
I was hoping someone could point me in the correct direction to have
Perl properly speak
I want to monitor a daemon's logs that updates randomly through the day
and night. Is there a way to open the log file and read the new records
as they come in the same way as tail -f does?
Thanks
Ken
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Ken Foskey wrote:
I want to monitor a daemon's logs that updates randomly through the day
and night. Is there a way to open the log file and read the new records
as they come in the same way as tail -f does?
Sure, look on cpan for File::Tail::App and File::Tail
--
To unsubscribe, e-mail
On May 29, 2006, at 18:19, Ken Foskey wrote:
I want to monitor a daemon's logs that updates randomly through the
day
and night. Is there a way to open the log file and read the new
records
as they come in the same way as tail -f does?
Sure, with File::Tail for example.
-- fxn
hi,lists,
I have a log file which is a symbol link to the real logfile,shown as following:
$ll mssvr.log
lrwxrwxrwx1 cmail root 40 Jan 14 00:00 mssvr.log -
/home/cmail/logs/mssvr.log.2006-01-14
I have to access this file in perl script with unix 'tail -f' command.Part
Jeff,
Maybe all you have to do is make some adjustments to the pipe you're
opening. Besides the well known -f switch, some tail's (like gnu
tail) support -F which means a file is followed by its name and the
opening is retried from time to time. From man tail (GNU):
-F same
@perl.org
Subject: Re: the 'tail' problem
Jeff,
Maybe all you have to do is make some adjustments to the pipe you're
opening. Besides the well known -f switch, some tail's (like gnu
tail) support -F which means a file is followed by its name and the
opening is retried from time to time. From man tail
links rather symbolic
ones, it looks like tail -F would do the magic without hassle.
Cheers,
Adriano.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
PM
To: Jeff Pang [EMAIL PROTECTED], beginners@perl.org
Subject: Re: the 'tail' problem
Jeff,
Maybe all you have to do is make some adjustments to the pipe you're
opening. Besides the well known -f switch, some tail's (like gnu
tail) support -F which means a file is followed by its name
Jeff Pang wrote:
hi,lists,
I have a log file which is a symbol link to the real logfile,shown as following:
$ll mssvr.log
lrwxrwxrwx1 cmail root 40 Jan 14 00:00 mssvr.log -
/home/cmail/logs/mssvr.log.2006-01-14
I have to access this file in perl script with unix 'tail -f
I don't know why it can't work for me.
I have tested it as following:
$ln -s mssvr.log.2006-01-14 mylog
$tail --follow=name --retry mylog
Now this command output the content of mssvr.log.2006-01-14 correctly.
So I continue to excute these commands (open another terminal):
$rm -f mylog
$ln
'tail -f' command.Part of
the code is below:
open (TAIL,tail -f $log|) or die can't open pipe:$!;
while(TAIL)
{
do something...
}
This script is a daemon script which run permanently.There is no problem when
in the same day.But when the date changed,the symbol link file
the symlink get changed at 00:00.
-Original Message-
From: JupiterHost.Net [EMAIL PROTECTED]
Sent: Jan 15, 2006 1:04 AM
To: beginners@perl.org
Subject: Re: the 'tail' problem
Jeff Pang wrote:
hi,lists,
Hello,
I have a log file which is a symbol link to the real logfile,shown as
following
Thanks all for your input. The File::Tail package works although it
seems to stop working once I restart the application writing to the
logfile. I've played around with the settings but I'll have to take it
up with the author.
Thanks again!
-Original Message-
From: Chris Knipe [mailto
Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post. - Sherm Pendley, Mac OS X list
Tielman Koekemoer (TNE) wrote:
Thanks all for your input. The File::Tail package works although it
seems to stop working once I restart the application
Hi All,
If I wanted to monitor a file in a way that would emulate tail -f
(in the shell), how would I open the file?
open(FILE, filename |); (?)
TIA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org
use File::Tail;
On Thu, 2005-05-19 at 11:37, Tielman Koekemoer (TNE) wrote:
Hi All,
If I wanted to monitor a file in a way that would emulate tail -f
(in the shell), how would I open the file?
open(FILE, filename |); (?)
TIA
On 5/19/05, Tielman Koekemoer (TNE) wrote:
Hi All,
If I wanted to monitor a file in a way that would emulate tail -f
(in the shell), how would I open the file?
open(FILE, filename |); (?)
TIA
http://perldoc.perl.org/perlfaq5.html#How-do-I-do-a-tail--f-in-perl-
--
Offer Kaye
On Thu, May 19, 2005 at 11:54:35AM +0530, Ramprasad A Padmanabhan wrote:
use File::Tail;
On Thu, 2005-05-19 at 11:37, Tielman Koekemoer (TNE) wrote:
Hi All,
If I wanted to monitor a file in a way that would emulate tail -f
(in the shell), how would I open the file?
open(FILE
emulates tail f- nicely, since it notices a filename
change and exits, on contrary of tail -f which has to be killed.
Rob use strict;
Rob use warnings;
Rob use IO::Handle;
Rob autoflush STDOUT;
Rob use Fcntl qw(:seek);
Removed line, as seek is not yet a tag in earlier Perl.
Rob my $file = 'junk.txt
out from the Perl code
above when junk.txt has been deleted, or renamed. Unfortunately, tail
-f does not exit...
Any idea how to do that?
--
Claude
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org
Everything ok, except that I would like to find out from the Perl code
above when junk.txt has been deleted, or renamed. Unfortunately, tail
-f does not exit...
Any idea how to do that?
Hi Claude,
You need to close and reopen the file if you want to check for a rename.
Something like the program
Rob == Rob Dixon [EMAIL PROTECTED] writes:
[...]
Rob You need to close and reopen the file if you want to check for a
Rob rename. Something like the program below.
[...]
Tx, Rob, I'll give feedback soon here!
--
Claude
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
gracefully.
Any suggestions?
Check out File::Tail on CPAN, particularly the section on 'select' and
the mentioned example script, it should get you close.
http://search.cpan.org/~mgrabnar/File-Tail-0.98/Tail.pm
And I might as well throw a POE reference in here, as usual this sort
Joel Newkirk wrote:
I'm interested in tailing two logs (qmail) simultaneously, and
interleaving the data in something approaching chronological sequence,
as well as dealing with logfile rotation gracefully.
Any suggestions?
Check out File::Tail on CPAN, particularly the section on 'select
I'm interested in tailing two logs (qmail) simultaneously, and
interleaving the data in something approaching chronological sequence,
as well as dealing with logfile rotation gracefully.
Any suggestions?
j
--
Not all those who wander are lost. - JRR Tolkien
--
To unsubscribe, e-mail:
Hi all
My woes continue
I had a great way to view system logs in real-time, all I did is direct the
output of the tail command to my browser - a simple tail-f worked well.
Since upgrading to RH8 and Apache 2.x this no longer works, though a tail
-n20 still does.
Does anyone have a way to output
-Original Message-
From: Palmer Greg [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 4:50 PM
To: NYIMI Jose (BMB)
Subject: RE: Unix ls -lrt | tail -1 in Perl
$filename = `ls -ltr|tail -1 $DIRECTORY`;
print $filename;
Sorry, i didn't mentioned that i wanted a pure perl
On Fri, 21 Mar 2003, NYIMI Jose (BMB) wrote:
-Original Message-
From: Palmer Greg [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 4:50 PM
To: NYIMI Jose (BMB)
Subject: RE: Unix ls -lrt | tail -1 in Perl
$filename = `ls -ltr|tail -1 $DIRECTORY`;
print
Sudarshan Raghavan wrote:
On Fri, 21 Mar 2003, NYIMI Jose (BMB) wrote:
From: Palmer Greg [mailto:[EMAIL PROTECTED]
$filename = `ls -ltr|tail -1 $DIRECTORY`;
print $filename;
Sorry, i didn't mentioned that i wanted a pure perl solution, thanks anyway.
my $latest = (sort {-M
Hello,
How can I do this unix command in Perl ? : ls -lrt | tail -1
Actually, i would like to get the most recent file from a given directory.
Thanks in advance for your input.
José.
DISCLAIMER
This e-mail and any attachment thereto may contain information which is confidential
On Thu, 20 Mar 2003, NYIMI Jose (BMB) wrote:
Hello,
How can I do this unix command in Perl ? : ls -lrt | tail -1
Actually, i would like to get the most recent file from a given directory.
my $latest = (sort {-M $b = -M $a} $dir/*)[-1];
or
my $latest;
while ($dir/*) {
$latest
-lrt | tail -1 in Perl
On Thu, 20 Mar 2003, NYIMI Jose (BMB) wrote:
Hello,
How can I do this unix command in Perl ? : ls -lrt | tail -1
Actually, i would like to get the most recent file from a given directory.
my $latest = (sort {-M $b = -M $a} $dir/*)[-1];
or
my $latest;
while ($dir
There's a FAQ that deals with coding a tail -f if you're logfile is on the
same box as the perl script.
But what if you want to use rsh to tail a file remotely?
Here's what I have:
--8---8---
#!/usr
Richard Fernandez wrote:
There's a FAQ that deals with coding a tail -f if you're logfile is
on the same box as the perl script.
But what if you want to use rsh to tail a file remotely?
Here's what I have:
--8--
-8
){ print usage.;exit 1;}
unless ( -f $ARGV[0] ){ print bad file name ;exit 1;}
$n = $ARGV[1]-1 || 9;
- Original Message -
From: Mrtlc [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 10, 2003 11:52 PM
Subject: tail + count
I wrote the following script
I wrote the following script as a windows tail + count function,
but it's too slow if the input is huge, how can it be improved?
if (!$ARGV[0]){
die(you've forgotten to enter the file name\n);
}
if (!$ARGV[1]) {
$n = 9; # output 10 rows by default
}
else {
$n = $ARGV
Mrtlc wrote:
I wrote the following script as a windows tail + count function,
but it's too slow if the input is huge, how can it be improved?
if (!$ARGV[0]){
die(you've forgotten to enter the file name\n);
}
if (!$ARGV[1]) {
$n = 9; # output 10 rows by default
}
else
Hi John
John W. Krahn [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
@ARGV == 2 and my $n = pop || 10;
$n will be undefined if @ARGV != 2. Need something like:
$n = @ARGV == 2 ? pop : 10;
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Is there a perl equivalent to the unix `tail' command? Where I could
grab the last line from a file without having to read the whole file?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Harry Putnam wrote:
Is there a perl equivalent to the unix `tail' command? Where I could
grab the last line from a file without having to read the whole file?
There is the module File::ReadBackwards;
# perl -MCPAN -e 'install File::ReadBackwards'
$ perldoc File::ReadBackwards;
bye,
Da.Ta
Hi,
I need to set up a perl job which will process the lastest entries on an
IIS web logfile.
E.g. every (say) 5 mins, a job will run processing new additions to the
file.
What is the best way to go about this?
Should I (when the process runs):
1) read thru the IIS logfile until I reach the
Hi,
I am trying to write a cgi program to tail -f a log file. I have a perl
script that will open and print the log file, however it closes as soon as
it reads whatever is in the file at that particular time. How do I mimic
tail -f functionality?
Thanks,
Max
--
To unsubscribe, e-mail: [EMAIL
On Fri, 12 Jul 2002 08:24:55 -0400, [EMAIL PROTECTED] (Fliptop)
wrote:
Max Clark wrote:
I am trying to write a cgi program to tail -f a log file. I have a perl
script that will open and print the log file, however it closes as soon as
it reads whatever is in the file at that particular time
- Original Message -
From: Max Clark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 11, 2002 6:43 PM
Subject: tail -f with cgi
Hi,
Hello Max,
I am trying to write a cgi program to tail -f a log file. I have a perl
script that will open and print the log file
-Original Message-
From: Max Clark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 7:44 PM
To: '[EMAIL PROTECTED]'
Subject: tail -f with cgi
Hi,
I am trying to write a cgi program to tail -f a log file. I
have a perl
script that will open and print the log file
Alright, what's a tail -f?
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:09 AM
To: 'Max Clark'; '[EMAIL PROTECTED]'
Subject: RE: tail -f with cgi
-Original Message-
From: Max Clark [mailto:[EMAIL PROTECTED]]
Sent: Thursday
- Original Message -
From: Bob Showalter [EMAIL PROTECTED]
To: 'Max Clark' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 12, 2002 11:08 AM
Subject: RE: tail -f with cgi
-Original Message-
From: Max Clark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002
-Original Message-
From: Shawn [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 12:29 PM
To: Bob Showalter; 'Max Clark'; [EMAIL PROTECTED]
Subject: Re: tail -f with cgi
- Original Message -
From: Bob Showalter [EMAIL PROTECTED]
To: 'Max Clark' [EMAIL PROTECTED
I found the file::tail module on cpan...
#!/usr/bin/perl -w
use File::Tail;
my $log = /usr/local/apache2/logs/access_log;
$file=File::Tail-new
(
name=$log,
interval=2,
maxinterval=10
);
while (defined($line=$file-read)) {
print $line;
}
It does exactly what
recently that would have been improved
in one place by its use.
But I still have a question :). As I understand it when tail-call
optimization is done automatically there are two advantages. One is
that the stack doesn't grow out of control, so that you don't have to
worry about blowing it up
have been improved in one place by its use.
But I still have a question :). As I understand it when tail-call
optimization is done automatically there are two advantages. One is that the
stack doesn't grow out of control, so that you don't have to worry about
blowing it up if you recurse very
From: Tagore Smith [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:Tail call optimization
Date sent: Tue, 28 May 2002 23:42:30 -0400
I came across this statement on the web:
Perl ... supports the tail-call optimization
I came across this statement on the web:
Perl ... supports the tail-call optimization (although you have to do it by
hand).
I was wondering if someone could give me an example of this. I know what
tail-call optimization means, and how to write tail-recursive functions, in
Lisp- just not sure
Hi there,
I have got the example of trailing a file from Perl Cookbook:
---
for (;;) {
while (FH) { print $_ }
sleep 1;
seek(FH, 0, 1);
}
---
However, if another program removes (all) lines from the file referenced by
FH, perl looses the trailing (for a undetermined
How about putting a file lock on it?
That way if someone tries to access it and write to it, it will not work.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
1 - 100 of 117 matches
Mail list logo