To answer some of your numbered questions

1. see Cwd

2. File::Find::Rule has found favor and can provide a good solution to finding files in the specified directories. Super Search is a good source for finding out more about File::Find::Rule as well as any other questions you might have.

To find the largest .txt file in each directory, you might want to see reduce from List::Util.
Update The largest could be found this way as well.

my @files = glob "*.txt"; my $largest = shift @files; for my $file (@files) { $largest = $file if -s $file > -s $largest; }

3. see mkdir

please help with directing me to which functions to use, particularly for sorting files by size and obtaining a list of the largest file in each subdirectory as a string separated by spaces,

Because some filenames/directories can themselves have spaces, it might be better to separate them with a tab character or even separate them by the newline character.

To see how to create a new file, look at the documentation for open.


In reply to Re: Advice/help with beginner script (file sorting, execute command line command) by Cristoforo
in thread Advice/help with beginner script (file sorting, execute command line command) by UserMane

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.