Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping perl script

Status
Not open for further replies.

geoffinva3

Technical User
Feb 15, 2005
9
US


I tried Perl and wrote the following bit of code: Now I need to not just print each line in the file to standard out but I want to ping each ip address on each line.
Any ideas?

Thanks


1: #!/usr/local/bin/perl

2:

3: if (open(MYFILE, "file1")) {

4: $line = <MYFILE>;

5: while ($line ne "") {

6: print ($line);

7: $line = <MYFILE>;

8: }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top