Thanks very much Ken, Ken, Dan, Matt, Sherm and Jarkko for
your excellent examples! I really appreciate the time
you've taken to share your code.
Hope you don't mind, but I have a few more questions. I've
been researching through my Perl books and think I
understand how most of the code below wo
On Thu, May 13, 2004 at 07:22:38PM -0500, Ken Youens-Clark wrote:
> The File::Find module can be a little cryptic, so you might be
> interested to look at Randal Schwartz's "File::Finder" module ...
Or Richard Clamp's File::Find::Rule.
--
David Cantrell | Degenerate | http://www.cantrell.org.
Joseph Alotta wrote:
> On May 13, 2004, at 11:12 PM, Matt Doughty wrote:
>
>
>>here is my little bit for making a really short solution.
>>
>>--Matt
>>
>>#!perl
>>my $dir = shift() || ".";
>>opendir(DIR, $dir);
>>print for(map { $_ . "\n" } sort { (stat($b))[9] <=> (stat($a))[9] }
>>grep { !/^.{
On May 14, 2004, at 12:46 AM, Joseph Alotta wrote:
All these solutions are still too verbose and self-documenting. Can
someone write something a little shorter, maybe a one-liner?
ls -lc | grep -v '^[ld].*'
Or did you want one line of Perl? ;-)
sherm--
On May 13, 2004, at 11:12 PM, Matt Doughty wrote:
here is my little bit for making a really short solution.
--Matt
#!perl
my $dir = shift() || ".";
opendir(DIR, $dir);
print for(map { $_ . "\n" } sort { (stat($b))[9] <=> (stat($a))[9] }
grep { !/^.{1,2}$/ } readdir DIR );
All these solutions
here is my little bit for making a really short solution.
--Matt
#!perl
my $dir = shift() || ".";
opendir(DIR, $dir);
print for(map { $_ . "\n" } sort { (stat($b))[9] <=> (stat($a))[9] } grep {
!/^.{1,2}$/ } readdir DIR );
On May 14, 2004, at 11:53, Ken Williams wrote:
Instead of using string-munging, you can use a real data structure:
How come no one here is using hash?
#!/usr/bin/perl -Tw
use strict;
my $dir = shift || '.';
my %mtime;
opendir my $dh => $dir or die "$dir:$!";
foreach my $f (grep !/^\./, readdir($dh
On May 13, 2004, at 6:19 PM, [EMAIL PROTECTED] wrote:
#!/usr/bin/perl
my $dir = "/Users/jay/Desktop/Other Stuff/old stuff 4";
opendir FOLDER, $dir or die "Cannot open $dir: $!";
foreach $file (readdir FOLDER) {
next if $file =~ /^\./;
$path = "$dir/$file";
next unless -f $path and -r $p
On Thu, May 13, 2004 at 07:19:54PM -0400, [EMAIL PROTECTED] wrote:
> Hello,
>
> I'm still extremely new to Perl, and was wondering if some
> of you might mind taking a peek at the code below and
> telling me if there's anything that could make it better or
> more efficient?
>
> The code below is
Hello,
I'm still extremely new to Perl, and was wondering if some
of you might mind taking a peek at the code below and
telling me if there's anything that could make it better or
more efficient?
The code below is my attempt at grabbing the files from a
folder and then sorting them by modificatio
10 matches
Mail list logo