Lauri Nikkinen wrote: > Hi, > > I'm trying to print directory sizes using script from > > http://coding.derkeiler.com/Archive/Perl/perl.beginners/2005-08/msg00693.html > > and when I try it from the cmd.exe > > C:\Perl>perl Print_directory_sizes.pl "C:/Temp" > > but I get an error message saying > > use of uninitialized value.... etc. > > Where is the problem? I'm using Win XP. > > ---code--- > #!/bin/perl > > use warnings; > use strict; > use File::Find::Rule; > > my $dir = $ARGV[0]; > my $size; > > find( sub { -f and ( $size += -s _ ) }, $dir ); > ---code---
The example that you link to uses the File::Find module. You have changed it to import File::Find::Rule without changing the calling code. Simply change the module back to File::Find and your program will be fine. Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/