Thanks for the responses! I can sort of see what's going on with your sample code. I assume I'm doing to replace DATA with the directory. Maybe not. I'm trying to make sense of the FAQ at the moment.

I suppose I actually need to modify my original intentions.

The data I need to read exists in directories within a parent directory. For example, I have directories 1, 2, 3, ... , 10, all within a parent directory (call it /users/parent/).

Within those folders is a file (file will always have the same name) with six columns with headers. I'm assuming the $value and $time are the headers of columns within my data file.

Additionally, I no longer need the difference. What I'd like to do is just pull the maximum value of a specific column within a specific range of column 1 (3000 to 3640), as well as the value in column two corresponding to the time closest to 3000 in column 1. These will be exported as two different columns to another file: max value in column one, "initial" value in column 2.

Ugh. Perl's notation is so different from what I've seen elsewhere. I feel like I'm drinking from a firehouse for a fairly simple problem.

EDIT: Working on it, btw. But it will take some time. Thanks for getting me started :)


In reply to Re^2: New to Perl - locating max, subtracting initial, printing output, all across several files in differing directories by jtrousde
in thread New to Perl - locating max, subtracting initial, printing output, all across several files in differing directories by jtrousde

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.