* Re: problem/bug: array definition from command (backticks)
@ 2001-06-27 4:01 Jörg Ziefle
0 siblings, 0 replies; only message in thread
From: Jörg Ziefle @ 2001-06-27 4:01 UTC (permalink / raw)
To: zsh-users
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-06-27 4:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-27 4:01 problem/bug: array definition from command (backticks) Jörg Ziefle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).