#!/usr/bin/perl opendir (DIR, "C:/Perl/bin/Anti") or die "Couldnt open directory: $!"; @files = readdir DIR; closedir (DIR); foreach $file (@files) { open(MYFILE,"C:/Perl/bin/Anti/$file") or die "Count open file :$!"; while(defined($ips=<MYFILE>)){ @array = $ips =~ m/\d+/; for($index=0; $index<@array; $index++) { for($count=0; ;$count++) { print "IP $count is $array[$index] \n"; last; } } } }
In reply to Unable to read files from a directory by antidote1316
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |