Ok, I'll have to try that modification. My intention was from the beginning to print all directories and their sizes to the STDOUT. Thank you for your help.
- L 2009/3/3 Wagner, David --- Senior Programmer Analyst --- CFS < david.wag...@fedex.com> > > ------------------------------ > *From:* lauri.nikki...@gmail.com [mailto:lauri.nikki...@gmail.com] *On > Behalf Of *Lauri Nikkinen > *Sent:* Tuesday, March 03, 2009 13:00 > *To:* Chas. Owens > *Cc:* Wagner, David --- Senior Programmer Analyst --- CFS; Perl Beginners > *Subject:* Re: Printing directory sizes > > Thanks Chas! > > On windows side this seems to work > > C:\>perl -MFile::Find -le "print 'ok'" > ok > > and it seems that File::Find module is installed though ppm won't locate it > (ppm query File::Find). And I don't know why. > > On mac's side I followed Chas's orders, but I can't get any output > > ~ > perl -MFile::Find -le 'print "ok"' > ok > ~ > cat Print_directory_sizes.pl > #!/usr/bin/perl > > use warnings; > use strict; > use File::Find; > > my $dir = defined $ARGV[0] ? $ARGV[0] : '.'; > my $size; > > find( sub { -f and ( $size += -s _ ) }, $dir ); > ~ > perl Print_directory_sizes.pl > ~ > > > or > > ~ > perl Print_directory_sizes.pl Documents/ > ~ > > > Do you know why? > You are not printing anything in your script. You add to $size, but > you must either do a print or printf depending on what you want to display > the results... > > If you have any questions and/or problems, please let me know. > Thanks. > > *Wags ;)*** > David R. Wagner > Senior Programmer Analyst > FedEx Freight > 1.719.484.2097 TEL > 1.719.484.2419 FAX > 1.408.623.5963 Cell > http://fedex.com/us > > > -L > > 2009/3/3 Chas. Owens <chas.ow...@gmail.com> > >> On Tue, Mar 3, 2009 at 14:47, Lauri Nikkinen <lauri.nikki...@iki.fi> >> wrote: >> > I uninstalled ActiveState Perl via Add/Remove Programs and installed it >> > (ActivePerl 5.10.0 Build 1004) again from here >> > >> > http://www.activestate.com/activeperl/ >> > >> > and I got the same answer from ppm query File::Find. I don't know if it >> has >> > something to do with the Windows 'cause I'm running Windows XP via >> Parallels >> > Desktop (as a virtual computer) on my Macbook Pro. I haven't had any >> > difficulties with other programs. >> snip >> >> File::Find is part of Core Perl. If it weren't installed by >> Activestate's Perl installer many people would be up in arms. Try >> writing a simple script using it or saying >> >> perl -MFile::Find -le "print 'ok'" >> >> in cmd.exe. >> >> -- >> Chas. Owens >> wonkden.net >> The most important skill a programmer can have is the ability to read. >> > >