Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1

    Perl - executing a file...?

    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

  2. #2
    martinthurn's Avatar
    Senior Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    183
    Downloads
    0
    Uploads
    0
    qx// does NOT return until the command is ALL FINISHED, and your code.pl does NOT ever finish because that's what File::Tail is designed to do.

 

 

Quick Reply Quick Reply

Click here to log in


How many letters in the word Rabroad

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I have problems executing perl programs in Fedora 11?
    By Akilesh K in forum Discuss PERL
    Replies: 1
    Last Post: 12-01-2009, 08:05 AM
  2. Executing Perl program on windows?
    By Nik in forum Discuss PERL
    Replies: 1
    Last Post: 10-17-2009, 04:17 PM
  3. Executing Perl program on windows?
    By Nik in forum Discuss PERL
    Replies: 1
    Last Post: 06-12-2009, 10:12 AM
  4. Executing Perl program on windows?
    By Nik in forum Discuss PERL
    Replies: 1
    Last Post: 05-30-2009, 03:44 AM
  5. Perl - executing a file...?
    By sarah g in forum Discuss PERL
    Replies: 0
    Last Post: 02-28-2009, 07:49 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •