Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem/bug: array definition from command (backticks)
- X-seq: zsh-users 3961
- From: Jörg Ziefle <gt4556a@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: problem/bug: array definition from command (backticks)
- Date: Wed, 27 Jun 2001 00:01:56 -0400
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Usually, I don't f'up on my own postings, but hey, here's a somewhat
nicer version of my mail folder printer for future reference:
--- BEGIN printmailfolders-zsh.pl
#!/usr/bin/perl -w
use strict;
my @MAILDIRS = ("$ENV{HOME}/Mail", "$ENV{HOME}/savenews");
my @folders;
foreach my $MAILDIR (@MAILDIRS) {
opendir DIR, $MAILDIR;
push @folders, grep {! /^\./ && -r $_ && -f _ && ! -d _ && -s _ && -T _} map {"$MAILDIR/$_"} readdir DIR;
closedir DIR;
};
@folders = map { m,^.*/([^/]+)$,; qq/"$_?New mail in $1."/} @folders;
print join "\\n", @folders;
--- END printmailfolders-zsh.pl
To potential Perl hackers that read this: Golf? ;-)
HTH,
Jörg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author