in reply to Populating an array with contents of a directory.
The -s function gives the size of the file. See perldoc perlfunc. The explanation of -s and other file test operators is given near the beginning of the docs here.#!/usr/bin/perl use strict; use warnings; my $dir = '/path'; my @names = map {[$_, -s]} glob "$dir/*"; for (@names) { printf "%-10s%s\n", reverse @$_; }
Hope this helps.
Chris
|
|---|