Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Problem with collect.pl



On Mon, 10 Aug 1998, Scott Wedel wrote:
> > I've encountered some problems while trying to build archetypes:  The
> > collect.pl script fails to scan the arch tree.
<snip>
> I looked this up in the perl 5 book and it mentions details with
> the input operator <> and using it for file globbing.  It mentions
> that the shell gets involved and other issues.
> 
> Anyway, the below should always work and be faster.
>  -    foreach $file (<$dir/*>) {
>  +    opendir(THISDIR, $dir);
>  +    local(@allfiles) = readdir(THISDIR);
>  +    closedir(THISDIR);
>  +    foreach $file (@allfiles) {

Um... It doesn't work...  Instead it just starts eating up memory.

As you mentioned that the problem might be shell related, so I tried all
the shells in the distribution:
   - Default, bash, version 1.14.7(1)   neither works
   - bash, version 2.02.0(1)            neither works
   - zsh, version 3.0.3                 neither works
   - tcsh, version 6.7                  original code works!

Nice.  That might explain why the glitch wasn't discovered earlier, all
the maintainers and developers (or anyone who recompiles archetypes) use
tcsh or csh.

Could some perl-guru provide a patch that would work on both bash and
*csh?  It feels quite ackward to install another shell to compile a
program.

	- Riba

[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]


References: