Im looking to put a loop into a program i have created but right now it only runs on a static IP hardcoded in the program. I would like it to loop through a list of IP addresses from a CSV file and loop until all IP have been used. Has anyone here done this or can point me in the right direction?
MCLASS80
0
Newbie Poster
Recommended Answers
Jump to PostSomething like this?
use strict; use warnings "all"; my @ip; open my $IN, "<csv.txt" or die "cannot open file to read.\n"; while(<$IN>) { @ip = split(",", $_); } close $IN; foreach(@ip) { print "$_\n"; }
We read the data from a file and then loop through …
All 4 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.