Lauri Nikkinen wrote:
It says that
*** no packages installed matching 'File::Find ***
I tried this also on my Mac and it goes like this
~ > perl -File::Find -le 'print "ok"'
ok
perldoc perlrun
[ snip ]
-Fpattern
specifies the pattern to split on if -a is also in effect. The
pattern may be surrounded by "//", "", or '', otherwise it will
be put in single quotes. You can’t use literal whitespace in
the pattern.
You are using the -F switch with the pattern 'ile::Find' so it will
*always* print "ok". You need to use either the -m switch or the -M
switch to have perl locate your module.
$ perl -MXXX -e1
Can't locate XXX.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.
~ > cat Print_directory_sizes.pl
#!/bin/perl
use warnings;
use strict;
use File::Find;
my $dir = $ARGV[0];
my $size;
find( sub { -f and ( $size += -s _ ) }, $dir );
~ > perl Print_directory_sizes.pl
invalid top directory at /System/Library/Perl/5.8.8/File/Find.pm line 592.
This message says that File::Find is installed at
/System/Library/Perl/5.8.8/File/Find.pm but that your problem is that
the value in $dir is incorrect for some reason.
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/