in reply to Re^3: Writing to file...
in thread Writing to file...

Ronald, I would beg to differ. Glob can be a real mess. grep and readdir works on all platforms.

The forward vs backslash is not an issue. Perl'ers take note: always use "/" instead of some convoluted "\\" idea for a Windows path. Perl will translate the "/" into the right thing for Windows.

Update:
There are plenty of "old" Perl 5.6 programs out there! I skipped 5.8 and went to 5.10, so I don't know what 5.8 does. The glob mess that exists in 5.6 is gonna be around for a long time.

Replies are listed 'Best First'.
Re^5: Writing to file...
by rovf (Priest) on Jul 23, 2009 at 07:28 UTC
    Glob can be a real mess.
    Could you give a concrete example? If this is the case, I would conclude that this is a bug to be reported. From doc:://File::Glob:
    File::Glob::bsd_glob() implements the FreeBSD glob(3) routine, which is a superset of the POSIX glob() (described in IEEE Std 1003.2 "POSIX.2"). bsd_glob() takes a mandatory "pattern" argument, and an optional "flags" argument, and returns a list of filenames matching the pattern, with interpretation of the pattern modified by the "flags" variable. Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob().

    -- 
    Ronald Fischer <ynnor@mm.st>
      This glob() weirdness is at least an ActiveState issue in their version 5.6 series, especially when trying to make .exe files. They have made progress with this in Perl 5.10, but I actually don't know if it is completely fixed or not. The grep on a readdir will always work.

      There is sometimes differences between the "spec" and what the code actually does, especially when dealing with multi-platform issues and in particular Windows vs *nix.