Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] glob, paging merlyn

Expand Messages
  • merlyn@stonehenge.com
    ... da5id 1. Is there a recursive version of glob? So if I went glob( *.pl ) it da5id would traverse subdirectories as well? (This is where I used my da5id
    Message 1 of 2 , Apr 5, 2007
    • 0 Attachment
      >>>>> "da5id" == da5id <da5id@...> writes:

      da5id> 1. Is there a recursive version of glob? So if I went glob("*.pl") it
      da5id> would traverse subdirectories as well? (This is where I used my
      da5id> recursion originally)

      File::Find does that. Also see my File::Finder in the CPAN for
      (what I think is) a nicer interface.

      da5id> 2. Does glob cough in certain situations? When I did a glob on a folder
      da5id> with subdirectories that had spaces in the name, it seemed to return the
      da5id> first part of a subfolder name without the space.

      The glob input has to be quoted, but the responses will be ready-to-use.

      So to glob the folder named "Foo Bar" for files that end in ".pm", use glob
      'Foo\ Bar/*.pm'. Note the single quotes, because you want a backslash
      followed by a space in the argument.

      da5id> 3. Is glob an older way of doing things? I see equivalents of IO::File
      da5id> and so on and wonder if I can still use the examples from my old copy of
      da5id> Learning Perl. I'd love to get a new one but because I'm always short
      da5id> on book money I'd like as much mileage out of my old edition as I can get.

      Glob is modern. I use it every day.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.