LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   perl question!!!!!!!! (https://www.linuxquestions.org/questions/programming-9/perl-question-703396/)

bpeck 02-09-2009 12:54 PM

perl question!!!!!!!!
 
- Issues an NSLOOKUP command 50 consecutive times against the DNS name www.amd.com using your own DNS server to resolve the requests. Again, flush the resolver cache between each command and display the elapsed time before the first and after the last NSLOOKUP command.

how could i plug this into this script??? or what would be an easier way to do this???

Telemachos 02-09-2009 01:38 PM

Huh?

Please put code into [code][/code] blocks, and please slow down and tell us more clearly (1) what you are trying to do and (2) what you've already done.

Usually, it's also helpful to tell us (3) what went wrong when you tried whatever you did in (2).

bpeck 02-09-2009 02:02 PM

I AM TRYING TO MAKE A PERL SCRIPT TO DO THE FOLLOWING

- Issues an NSLOOKUP command 50 consecutive times against the DNS name www.amd.com using your own DNS server (ip address 192.168.1.100) to resolve the requests. Again, flush the resolver cache between each command and display the elapsed time before the first and after the last NSLOOKUP command.

i am lost....i didnt mean to post all of that stuff before that!!

bpeck 02-09-2009 04:21 PM

anyone????? any ideas???? bump for some help fast!!!!! :cry:

Telemachos 02-09-2009 05:26 PM

Double posting and bumping it won't help. If you want to try for more immediate help, try an irc #perl room.

bpeck 02-09-2009 05:41 PM

sorry guys....just i am new at this, and just get nervous!! I wont bump anymore!!!! Telemacho would you be able to help me?

adam999 02-16-2009 05:05 PM

Code:

#!/usr/bin/perl

use Time::HiRes qw( clock gettimeofday tv_interval );


while ($p < 50)
{
 $time1 = [gettimeofday];
 system("nslookup www.amd.com");
 $time2 = [gettimeofday];
 print("Elapsed: " . ($elapsed = tv_interval $time1, $time2 ) . "\n");
 $p ++;
}



All times are GMT -5. The time now is 11:00 AM.