Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: filtering file names to be added to an array...maybe.

by myocom (Deacon)
on Jun 06, 2001 at 09:33 UTC ( [id://86130]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: filtering file names to be added to an array...maybe.
in thread filtering file names to be added to an array...maybe.

As the docs say, it globs like /usr/sh would. And I tested this sort of glob on Win32 and it worked just fine.

Update: Excellent point, Coyote.

  • Comment on Re: Re: Re: filtering file names to be added to an array...maybe.

Replies are listed 'Best First'.
Splitting hairs
by Coyote (Deacon) on Jun 06, 2001 at 10:01 UTC
    There is a small issue with glob between Win32 and *nix. Consider a directory that contains files named "uc.DAT" and "lc.dat". Let's use this code to glob all files with an extension of dat on a linux box and a Win98 box (I don't have an NT box handy so YMMV).

    #!/usr/bin/perl -w use strict; use Data::Dumper; my @files = glob('*.dat'); print Dumper(\@files);
    Running this on linux yields this output:

    $VAR1 = [ 'lc.dat' ];
    On Windows 98, you get the following:

    $VAR1 = [ 'lc.dat', 'uc.DAT' ];

    The problem here is that Windows is case insensitive, but case preserving. This could be a potential problem if you are expecting the same output from glob on both platforms.

    ----
    Coyote

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://86130]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found