Hi,
I have read around and cannot seem to find an answer to this, and it's
driving me a bit nuts. I have a small script that I am trying to use to list
the items in a directory and the size of the items. The script works
perfectly if I run it in the directory itself, but if the script is
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 =
On Sep 18, 1:59 pm, [EMAIL PROTECTED] (Telemachus Odysseos)
wrote:
The script works
perfectly if I run it in the directory itself, but if the script is
somewhere else in my system, it prints the filenames but not the sizes.
That's because readdir returns a plain filename. You need to either
Telemachus Odysseos wrote:
Hi,
Hello,
I have read around and cannot seem to find an answer to this, and it's
driving me a bit nuts. I have a small script that I am trying to use to list
the items in a directory and the size of the items. The script works
perfectly if I run it in the
Michael Pratt wrote:
This is what I want to do and I dont know where to start:
List files in a directory taking that list with just the filename and no
other information. using that information and populating a listbox.
Check out 'perldoc -f opendir perl'. Perhaps the File:: modules suits
Michael Pratt wrote:
This is what I want to do and I dont know where to start:
List files in a directory taking that list with just the filename and no
other information
Use the glob operator of perl (perldoc -f glob)
while (*) {
print $_\n;
}
This should print
This is what I want to do and I dont know where to start:
List files in a directory taking that list with just the filename and no
other information. using that information and populating a listbox.
Can someone help?
Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional