in reply to List Contents of Windows Directory Folder
With "type" you mean the suffix of the file(s), right? Here is another small solution that might do the job. Give it a try. It should be easy to order the output according to your needs. Some illuminated brothers provided already some links for further reading/diving deeper a.s.o.
#!c:/perl/bin/perl.exe + use strict; use warnings; use IO::All; use File::Basename; my ( $in, $out, $io_objects, @line ); ( $in, $out ) = @ARGV; @io_objects = io($in)->all; for my $io_object (@io_objects) { if ( $io_object->type eq 'file' ) { @line = ( $io_object->name, ( $io_object->stat )[7], ( $io_object->stat )[9], ( fileparse( $io_object, qr/\.[^.]*/ ) )[2], ); } join( "\t", @line ) . qq(\n) >> io($out); } __END__
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
In Section
Seekers of Perl Wisdom