in reply to Opendir error
Update: Actually your usage of readdir and <> operator is incorrect. readdir accepts only one argument - directory handle and <> can read only from file handles. Correct code should look like:opendir(DIR,"/some_dir") or die "Cannot open directory: $!";
#!/usr/bin/perl -w use strict; opendir DIR, '/some_dir' or die "Cannot open directory: $!"; my @files = grep !/^.$/, readdir DIR; closedir DIR;
--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
|
|---|