hi guys, I would like ask why my script is not working as expected, everthing is working good excep the line that exec system ......, it is strange but if I exec the line on a separate script it works and do the job, any help would be preciated.. following , the code

#!/usr/bin/perl -w use strict; use File::Tail; my $file = File::Tail->new( name =>'/var/log/dhcpd.log', interval => 1, maxinterval => 1, resetafter=> 5, ); while (defined(my $line=$file->read)) { print $line,"\n"; if ($line =~ /^(.*) mdz-shaper1 dhcpd: DHCPACK on ([0- +9\.]+) to ([[:xdigit:]:]+).* ([0-9\.]+)/) { my ($date,$client_ip,$client_mac,$master_ip) = + ($1,$2,$3,$4); system "sed -i '/$client_mac/d' /opt/btb_webservice/ve +r3/lease_list.txt"; if(($client_ip)&&($client_mac)&&($master_ip)){ system 'echo "'.$date.' '. $client_ip.' '.$client_mac.' +'. $master_ip.'"'.' >> /opt/btb_webservice/ver3/lease_list.txt'; } } } 1;

In reply to tail script by leostereo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.