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
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |