| [reply] |
opendir, readdir and closedir---how did I never know about those? I currently do quite a lot of reading in the contents of directories, and so far I've always done it by endless constructs like
$dir_list=`ls -1 */*`;
@files=split(/\n/,$dir_list);
D'oh! and thanks!
why_bird
........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......
| [reply] [d/l] |
Also, if your SysAdmin won't let you install Perl modules in the usual place (/usr/lib* usually I think), but you can install elsewhere, this works for me (I tried to find the reference on Google, but couldn't):
- download, and unzip the file for MyModule from CPAN
- Extract to directory ~/MyDir
- cd to ~/MyDir/MyModule
- type perl Makefile.PL PREFIX="~/PerlModules/"
- type make test; make; make install as usual for a manual install
- Find the directory in ~/PerlModules in which MyModule.pm resides.
- Edit your ~/.cshrc (different for different shells) to contain the line 'setenv PERL5LIB
~/PerlModules/Directory_For_MyModule'
I know this doesn't help much if you're on Windows and the last step will be different for different UNIX shells, but I was stuck on this for a while, and if you Google, you'll likely find more (and better) information than I can give!
why_bird
edit: Found it! Here is a reference about how to install without root permissions, which also tells you an alternative to setting the environment variable PERL5LIB. And it talks about what to do on Windows.
........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......
| [reply] |
You can use diff (if available) and parse its results:
$ mkdir -p dir1/a/b/c
$ mkdir -p dir2/a/b
$ echo 1a1 > dir1/a/1
$ echo 2a1 > dir2/a/1
$ touch dir1/a/2
$ touch dir2/a/2
$ touch dir1/a/b/x
$ diff -rq dir1 dir2
Files dir1/a/1 and dir2/a/1 differ
Only in dir1/a/b: c
Only in dir1/a/b: x
| [reply] [d/l] [select] |