Ok, thanks. Now I notice that I did not understand correctly what this
script does. I was trying to print sizes of all directories in the directory
tree. But anyway, I appreciate your kind help!

-L

2009/3/3 Chas. Owens <chas.ow...@gmail.com>

> On Tue, Mar 3, 2009 at 14:59, Lauri Nikkinen <lauri.nikki...@iki.fi>
> wrote:
> snip
> > On mac's side I followed Chas's orders, but I can't get any output
> snip
> > #!/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 );
> snip
>
> That is because you aren't outputting anything.  Try this:
>
> #!/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 );
>
> print "size is $size\n";
>
>
> --
> Chas. Owens
> wonkden.net
> The most important skill a programmer can have is the ability to read.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to