hello, if this group is still alive.
i have code to sort items in a directory (below). i'd like to be able
to show only files that start with an 'r'. thanks in advance for your
help. let me know if you know of a better place to post.
opendir(STOCKBACKGROUND, ".") || &error("STOCKBACKGROUND"); stockbackgrounds = readdir(STOCKBACKGROUND); stockbackgrounds = sort {lc($a) cmp lc($b)} stockbackgrounds;
closedir(STOCKBACKGROUND);
It appears to mostly be dead. I think I'll be unsubscribing shortly.
I don't know of a better place for general perl questions though. stockbackgrounds = grep /^r/, readdir(STOCKBACKGROUND)
should do the trick. The grep limits it to filenames that begin with r.
On Fri, Mar 7, 2008 at 9:52 PM, Fred Garvin < ahqmed%40hotmail.com">ahqmedhotmail.com> wrote:
>
> hello, if this group is still alive.
> i have code to sort items in a directory (below). i'd like to be able
> to show only files that start with an 'r'. thanks in advance for your
> help. let me know if you know of a better place to post.
> opendir(STOCKBACKGROUND, ".") || &error("STOCKBACKGROUND");
> stockbackgrounds = readdir(STOCKBACKGROUND);
> stockbackgrounds = sort {lc($a) cmp lc($b)} stockbackgrounds;
> closedir(STOCKBACKGROUND);
>
>