skyler has asked for the wisdom of the Perl Monks concerning the following question:
#! perl -w use strict; my $line = 'C:\08\00004DC4.013'; opendir MYDIR, $line or die $! ; my @allfiles = grep { $_ ne '.' and $_ ne '..' } readdir MYDIR ; my @files = grep { !-d } @allfiles ; my @dirs = grep { -d } @allfiles ; print "Current directory contains " . @files . " files and " . @dirs . " directories.\n" ; print "@allfiles\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: list array
by tachyon (Chancellor) on Feb 19, 2003 at 01:50 UTC | |
by BrowserUk (Patriarch) on Feb 19, 2003 at 03:35 UTC | |
|
Re: list array
by Cabrion (Friar) on Feb 19, 2003 at 01:09 UTC | |
by skyler (Beadle) on Feb 19, 2003 at 01:52 UTC | |
by graff (Chancellor) on Feb 19, 2003 at 02:52 UTC | |
|
Re: list array
by Aristotle (Chancellor) on Feb 19, 2003 at 01:39 UTC | |
by skyler (Beadle) on Feb 19, 2003 at 02:12 UTC | |
by Aristotle (Chancellor) on Feb 19, 2003 at 06:26 UTC | |
|
Re: list array
by djantzen (Priest) on Feb 19, 2003 at 01:44 UTC | |
by Aristotle (Chancellor) on Feb 19, 2003 at 06:29 UTC | |
by djantzen (Priest) on Feb 19, 2003 at 06:33 UTC | |
by Aristotle (Chancellor) on Feb 19, 2003 at 07:05 UTC |