5.004_69 win32 Glob problem 
Author Message
 5.004_69 win32 Glob problem

Quote:

> There is a new version of Perl I downloaded from
>         http://www.*-*-*.com/

> This is the new long awaited merged GSAR and ActiveState version!

Hmmm.  I see ActiveState is describing it as a beta release.  As
perl5.004_69 has not yet been described by its developers (who
congregate on the perl5-porters mail list) as ready for beta release
(close, but not yet ready), I think ActiveState is jumping the gun.

(You can find information on how to join the perl5-porters list at
< http://www.*-*-*.com/ >.  ActiveState lists more-or-less Win32-specific
lists at < http://www.*-*-*.com/ ;.)

But anyway...

Quote:
> It seems to fail returning directory nodes using the following
> segment:
...
> This match fails completely on win98 but of course works on UNIX.
> It used to work with the previous GSAR port.

As with any suspected bug in perl, try putting this information in a bug

perlbug program to help create the report.  Bug reports are seen by
Perl's developers, and reports concerning development versions are
welcome -- although don't expect too much sympathy if using a
development version in a production situation is causing you grief.  You
could also take the matter up with ActiveStste direct at

Quote:
> Is there a more efficient way to return a list of subdirectories with
> the 4-th level subdirectory matching in "*-*" (star dash star)?
> without using globing?

Personally, I'd use the File::Find module to select the target files.
Unfortunately, it doesn't currently have a built-in emulation of GNU
find's -maxdepth and -mindepth options, which would make your life
really easy, but you should be able to code these yourself pretty
easily.  If File::Find works for you, that's great.  But please don't
let that stop you from submitting a bug report.
--
Dominic Dunlop


Fri, 22 Dec 2000 03:00:00 GMT  
 5.004_69 win32 Glob problem

Hi Dominic:

Quote:
>Hmmm.  I see ActiveState is describing it as a beta release.  As
>perl5.004_69 has not yet been described by its developers (who
>congregate on the perl5-porters mail list) as ready for beta release
>(close, but not yet ready), I think ActiveState is jumping the gun.

I thought so at first as well. But they DO include suitable disclaimers.
Since many Win32 users don't have the tools to build their own
perl from the development source kit (NT and a supported compiler
and a suitable shell, at least), this will help identify some bugs
without forcing an early maintenance release. I would certainly
agree if they had tried 5.004_61 as a beta.

-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)



Fri, 22 Dec 2000 03:00:00 GMT  
 5.004_69 win32 Glob problem

Dominic,

Thanks, good suggestion.  I implemented my own  recursive function
that returns the same values that glob("$dir") does called
"myglob($dir, $depth, ...)" that looks pretty ugly but works well.
I count the "/" characters in a string using "tr" to keep track of the
recursion depth. Its amazing all the work (<*/*/*/*-*>) used do!
I heard somewhere that glob() is pretty inefficient so prehaps this
is a blessing in disguise.  I also filed a trouble report to ActiveState
which they are probably expecting anyway.

Quote:
> > Is there a more efficient way to return a list of subdirectories with
> > the 4-th level subdirectory matching in "*-*" (star dash star)?
> > without using globing?

> Personally, I'd use the File::Find module to select the target files.
> Unfortunately, it doesn't currently have a built-in emulation of GNU
> find's -maxdepth and -mindepth options, which would make your life
> really easy, but you should be able to code these yourself pretty
> easily.  If File::Find works for you, that's great.  But please don't
> let that stop you from submitting a bug report.
> --
> Dominic Dunlop

--
 Matthew Morley


Fri, 22 Dec 2000 03:00:00 GMT  
 5.004_69 win32 Glob problem

Quote:

> It seems to fail returning directory nodes using the following
> segment:

>   foreach my  $node (<*/*/*/*-*>)

did you try?

        foreach my  $node (<*\\*\\*\\*-*>)

Remember that you are on Win32. If I remember correctly there is some
PerlGlob.exe
in the previous builds, so maybe you have to use backslashes as the
directory separators
with it.

I do not have ActivePerl installed so I cannot test, but maybe this
could help.

Quote:
> Any ideas?  Thanks.
> --


HTH, Jenda


Sat, 23 Dec 2000 03:00:00 GMT  
 5.004_69 win32 Glob problem


: I heard somewhere that glob() is pretty inefficient so prehaps this
: is a blessing in disguise.

If you have a C compiler, you can build

    <URL:http://www.cs.uah.edu/~gbacon/perl/File-BSDGlob-0.94.tar.gz>

which also works on Win32.  In the standard distribution, there is a
module called File::DosGlob that also does globbing.

Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF



Sat, 23 Dec 2000 03:00:00 GMT  
 5.004_69 win32 Glob problem
)
) Thanks, good suggestion.  I implemented my own  recursive function
) that returns the same values that glob("$dir") does called
) "myglob($dir, $depth, ...)" that looks pretty ugly but works well.
) I count the "/" characters in a string using "tr" to keep track of the
) recursion depth. Its amazing all the work (<*/*/*/*-*>) used do!
) I heard somewhere that glob() is pretty inefficient so prehaps this
) is a blessing in disguise.  I also filed a trouble report to ActiveState
) which they are probably expecting anyway.

To make it efficient, just do:

    C:> set PERL5OPT=-MFile::DosGlob=glob
or
    use File::DosGlob qw(glob);

then glob("*/*/*/*-*") will probably be more efficient than
anything you throw together.

) > > Is there a more efficient way to return a list of subdirectories with
) > > the 4-th level subdirectory matching in "*-*" (star dash star)?
) > > without using globing?

Using glob() from any module [File::DosGlob or File::KGlob as two
examples] is about as efficient as you can get.

) > Personally, I'd use the File::Find module to select the target files.

That would do the same work as glob() but would waste work finding
things you didn't want.
--
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)



Sat, 23 Dec 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to glob using short filenames under Win32?

2. Using glob() w/WinNT vs. glob() w/Win95

3. Win32: File glob causes floppy to chatter

4. glob not working win32?

5. Perl for Win32, glob, and Spaces in Filenames

6. perl5.001m - a patch to truncate for filehandles as globs/ref globs

7. glob problem installing perl m88k

8. Fixed a small problem in glob.pl

9. GLOB PROBLEMS WITH PERL5.001l,m on SunOS 4.1.4

10. glob problem with perl5.001l,m etc

11. glob spawning problem

12. glob problem

 

 
Powered by phpBB® Forum Software