"Telemachus Odysseos" schreef:
> [...] it prints the filenames
> but not the sizes. [...]
perldoc -f readdir:
"you'd better prepend the directory in question".
> #!/usr/bin/perl
Missing:
use strict;
use warnings;
> opendir(CD,"/path/to/directory/here");
my $dir_name = "/path/to/directory/here";
opendir my $dir_handle, $dir_name or die "$!";
> while ( $_ = readdir(CD)) {
while (my $dir_entry = readdir $dir_handle) {
> next if $_ eq "." or $_ eq "..";
next if -d "$dir_name/$dir_entry";
> print $_, " " x (30-length($_));
> print (-s $_ );
> print "\n";
printf "%30s %d\n", $dir_entry, -s _;
> }
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/