Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > how to read file from sub-directories and do an average?

Thread Tools

how to read file from sub-directories and do an average?

Eric Schwartz
Posts: n/a
Tad McClellan <(E-Mail Removed)> writes:
> Ross <(E-Mail Removed)> wrote:
>> @inputdirname = readdir(WORKINGDIR);
>> foreach $inputdirname (sort @inputdirname) {

> There is no need for a temporary array:
> foreach $inputdirname (sort readdir WORKINGDIR) {

No, but I have found that unless memory usage is a specific
optimization goal, temporary variables help tremendously in debugging,
and I will often use them even if they are not strictly required. I
could easly insert a

local $" = ', ';
print STDERR "inputdirs: [@inputdirname]\n";

block if I don't seem to be getting what I want to, or if I'm using
the debugger (mad props to Devel:tkdb!), set a breakpoint after the
readdir() call.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM vs.,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM doesn't read the whole file Sreejith K Python 24 03-24-2009 12:20 PM
Database file and folder are not read only but error message says it is read only?? keithb ASP .Net 2 06-07-2006 03:40 PM
jython/python: read file and allow read to be terminated py Python 0 01-27-2006 08:41 PM