Re:Perl system( ) command execution.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davyy
    New Member
    • Oct 2012
    • 1

    Re:Perl system( ) command execution.

    Hi,
    Recently I started to learn Perl programming.I am using windows 7 OS. Please find the following Perl program. If I execute the below script it will show the output. The issue is that if i am executing the same script immediately again it won't execute. If I wait for5 minutes, then it executes.
    I tried the same scripts in XP,it is working properly.

    Code:
    print "Enter the command \n";
    chomp($cmd=<stdin>);
    system("$cmd>ping.txt");
    open($fh,"<","ping.txt") or die "could not open the file \n";
    print "\n \n \n \n";
    while($line=<$fh>)
     {
       if($line=~m/minimum/i)
          {
             print "Appropriate round trip time:  \n";
             print "$line \n";
           }
     }
    Thanks,
    Dav
    Last edited by Meetee; Oct 5 '12, 05:15 AM. Reason: code tags added
Working...