Hi, thank you for the help. I am not completely sure what your code is does, but the
next if $entry eq '.'; next if $entry eq '..';
did help. I have combined your code with something of another user to come up with this:
#!/usr/bin/perl -w use strict; use warnings; open (Output, ">Output.txt") or die "Can't open"; my $tmp_dir= 'C:\Users\ZB\Desktop\Text Files'; opendir (DIR, $tmp_dir) or die $!; while (my $file_name = readdir(DIR)) { next if $file_name eq '.'; next if $file_name eq '..'; print "$file_name\n"; } close (Output) closedir(DIR);
All it does is print all the file names in my directory as output(so at least I am on the right path). However I want to iterate through each text file and do some basic calculations(all in 1 sub) within each file. Any ideas?
In reply to Re^2: Open a folder
by Dr Manhattan
in thread Open a folder
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |