On 12 Jun 2007 at 16:26, [EMAIL PROTECTED] wrote:

> Looking for some help here you perl geniuses you : )
> 
> I need a program that will list all of the files in a directory.
> Without any arguments the program will list only the files (not
> directories) in the current directory.  But I must have some command
> line options:
> 
> -d <with 0 or 1 directory argument> if no argument is given, the cwd
> is used.  If the argument given is not a directory an error is thrown.
> The output needs to have the following headers:
> File Name | Size | Owner | Group ( with no pipes)
> 
> -l displays a long listing (can be used with -d as "script.pl -l -d
> <dirname>")
> The output needs to have the following headers:
> File Name | Size | Owner | Group (with no pipes)
> 
> no parameters - show the files in the cwd
> The output needs to have the following header:
> File Name


You certainly know exactly what you want.

perldoc -f readdir      # how to read a dir and grep for files only

perldoc perlvar         # for an explanation of @ARGV and processing of 
command-line args.

perldoc -f sprintf/printf               # For a way to nicely format some 
headers 
or
perldoc -f format                       # For an alternative way to format some 
headers.

See how you get on then, if your stuck, mail the list showing what 
you've tried and your'll get more pointers then.

Good luck,




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to