Permabanned
Hi guys,
I've only been playing round with perl for a couple of days so there might be an easy way round this but I'd appriciate your help if you can.
Anyway, I've written a script that polls a directory for files and based on the criteria of the filename, renames them and puts them into folders. The script itself works fine, although it keeps trying to access the . and .. files! Is there anyway to ignore them?
Here is a snippit
I imagine the "while" line will need something to exlude . and ..
Cheers
I've only been playing round with perl for a couple of days so there might be an easy way round this but I'd appriciate your help if you can.
Anyway, I've written a script that polls a directory for files and based on the criteria of the filename, renames them and puts them into folders. The script itself works fine, although it keeps trying to access the . and .. files! Is there anyway to ignore them?
Here is a snippit
Code:
opendir camdir, "$camdir" or die print "Cannot open $camdir!!! $!\n";
@files=();
while ($files = readdir camdir) {
print "\nFound a file called -$file";
push(@files, "$files");
}
I imagine the "while" line will need something to exlude . and ..
Cheers