in reply to Re^13: Perl vs C
in thread Perl vs C

You might be interested in On Scalar Context

Replies are listed 'Best First'.
Re^15: Perl vs C
by Marshall (Canon) on Mar 16, 2009 at 17:53 UTC
    Thanks! Great tips!

    I would say that after a quick glance, glob() is a very bad idea. I've been in "glob hell" a few times and this is a very bad place to be! Even amongst *NIX platforms there are variances and when I started doing code for WinX platforms, this became even nastier! I don't if there is a FAQ about this, but the portable way is to open a dir, read it, use grep to get what you want. Glob() is easy, but not portable.

      Glob() is easy, but not portable.
      So what? Just refrain from it if portability is an issue. It may surprise you, but large volumes of code are written where portability isn't an issue at all.
        I'm not surprised at all! The thing where this really bit my rear-end was a multi-version-Windows platform deployment. It turns out that these Windows names with spaces in them and other weirdo "DOS" names can cause problems! I haven't seen a problem yet on a *NIX platform.