Re: Strange problem with glob <>



Hi Madhur,


2006/12/28, Madhur Kashyap <physiologoius@xxxxxxxxx>:

Hi there,

Have a look at these two different implementations. IMPL2 works somehow.
The
problem I am facing is that the glob <$pat> does not return any value in
IMPL1 but it returns in IMPL2. Can somebody tell what could be the
problem.

I have also tried including the advanced glob module using

use File::Glob qw(:globally :case);

[snip]


First of all, I'd like to suggest you activate strict and warnings pragma.
It will help you to catch any mistakes you did. Another suggestion is using
the Getopt::Std or Getopt::Long modules, instead of writing your own
argument parser.

For resolving your file search problem, I suggest the File::Find or
File::Find::Rule modules instead. glob can give you headaches, and it
doesn't support regexes, just shell like substitution.

HTH

--
Igor Sutton Lopes <igor.sutton@xxxxxxxxx>


Relevant Pages

  • Re: Strange problem with glob <>
    ... problem I am facing is that the glob does not return any value in ... IMPL1 but it returns in IMPL2. ... and you'll probably see that <$pat> is being interpreted as an attempt to read from a file. ...
    (perl.beginners)
  • Strange problem with glob <>
    ... Have a look at these two different implementations. ... IMPL1 but it returns in IMPL2. ... I have also tried including the advanced glob module using ... } elsif { ...
    (perl.beginners)
  • Re: Newbie: Joining Lists
    ... import glob ... filenames = [glob.glob(pat) for pat in patterns] ...
    (comp.lang.python)