Perl - executing a file...?

  • Thread starter Thread starter sarah g
  • Start date Start date
S

sarah g

Guest
Hello ^_^
I have this code
Eco.pl

$command="perl code.pl";
$cmd=qx/$command/;
print $cmd;

where code.pl has:
use File::Tail;
$name="log.txt";
$file=File::Tail->new(name=>$name, maxinterval=>1,interval=>1, adjustafter=>1);
while (defined($line=$file->read)) {
if ($line=~/http/i){
print "$line";
}
}


But it's not working with me... when i run eco.pl the code works without errors but it doesn't do its job and when I run code.pl normaly from Dos prompt it works well...

also.. when i use eco.pl when code.pl has this code
print "hi";
it works good... so what's wrong
 
Back
Top