antidote1316 has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that its not reading from the directory...its saying that permission is denied...can someone tell me if there is something wrong with the format...my regex is correct..
#!/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; } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unable to read files from a directory
by graff (Chancellor) on May 14, 2009 at 03:43 UTC | |
by bluto (Curate) on May 14, 2009 at 15:07 UTC | |
by antidote1316 (Initiate) on May 14, 2009 at 17:38 UTC | |
by antidote1316 (Initiate) on May 14, 2009 at 05:25 UTC | |
by graff (Chancellor) on May 14, 2009 at 06:26 UTC | |
Re: Unable to read files from a directory
by kennethk (Abbot) on May 14, 2009 at 03:01 UTC | |
by GrandFather (Saint) on May 14, 2009 at 03:12 UTC | |
by antidote1316 (Initiate) on May 14, 2009 at 03:14 UTC | |
Re: Unable to read files from a directory
by lakshmananindia (Chaplain) on May 14, 2009 at 02:08 UTC | |
Re: Unable to read files from a directory
by Marshall (Canon) on May 14, 2009 at 03:29 UTC |
Back to
Seekers of Perl Wisdom