Jun 3, 2011, 3:50 AM
Post #1 of 4
open a file with "tail"
I need some help on this, please.
I'm trying to write my script to open a chat log file, parse a string and send a message to the user every time he log in chat (jabber, don't know if it has importance). It works only a little after I run it. It parses fine few rows and after that is hanging on something and do nothing anymore...
I don't see what is wrong with it... Can you take a look and give me a hint please?
open(LOGFILE,"tail -f chat.log |") || die ("Failed!\n");
if (<LOGFILE> =~ m/user_available for /)
my $string = "$'";
$string =~ /^(.*?)\s/;
my @value = split(/"/, $1);
my $cmd = "echo `/path/to/command/` | sendxmpp -i @value\@domain.com -t --message-type=headline -v";