I don't get any errors when running the script, it just doesn't print any
file size values.

A copy of the output is below:

c:\proggy
c:\proggy/counter.bak
c:\proggy/counter.exe
c:\proggy/counter.pl
c:\proggy/error.txt
c:\proggy/filelist.pl
c:\proggy/filelisting.txt
c:\proggy/linecount.pl
c:\proggy/list.txt
c:\proggy/list2.txt
c:\proggy/lister.pl
c:\proggy/orig.pl

Any help appreciated.

Jane


----- Original Message ----- 
From: "Jan Eden" <[EMAIL PROTECTED]>
To: "Ryan Thomas" <[EMAIL PROTECTED]>; "Perl Lists" <[EMAIL PROTECTED]>
Sent: Wednesday, April 21, 2004 12:59 PM
Subject: Re: Problem with Code


Hi Jane,

----- Original Message -----
From: Ryan Thomas
Sent: 21.04.2004, 12:18 Uhr

>Hello All
>
>I have a script below that lists a directory tree structure (thanks for the
base
>code Jan!)and have modified it, unsuccessfully, to add the file size.
>
>What have i done wrong ??
>
>The output I am looking for is:
>
>c:\anydir\foo.txt 1,102
>
>code:
>
># Reads a directory tree and parses the results
>
># use strict;
>use File::Find;
>use File::stat;
>use Cwd;

You should not comment 'use strict;' which will force you to use good
programming style.

Apart from that, your script works for me. If you want the output mentioned
above, though, you would have to write (printf formatting left out):

>find ( sub { print qq{$File::Find::name };
>$size=(stat($File::Find::name))[7];
>print $size; }

What error messages do you get?

- Jan
-- 
There's no place like ~/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to