Re: Strange problem with glob <>



On 12/28/2006 01:42 AM, Madhur Kashyap wrote:
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.
[...]


Use strictures and warnings, and you'll probably see that <$pat> is being interpreted as an attempt to read from a file. Use glob($pat) instead.

The Switch module evidently installs a source filter that has some strange effects on Perl code. I advise avoiding it.



.



Relevant Pages

  • Re: Strange problem with glob <>
    ... problem I am facing is that the glob <$pat> does not return any value in ... IMPL1 but it returns in IMPL2. ... I have also tried including the advanced glob module using ...
    (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: Another one finished. :)
    ... PAT in VA/USA ... jury duty was at least ... facing came out rather well; ...
    (rec.crafts.textiles.quilting)
  • Re: Another one finished. :)
    ... Oh Sandy, that is so lovely. ... The bubbly filler stitch is wonderful; and no evidence of a facing at all. ... jury duty was at least ... instead -- with our Pat on the Hill's encouragement. ...
    (rec.crafts.textiles.quilting)
  • Re: Newbie: Joining Lists
    ... import glob ... filenames = [glob.glob(pat) for pat in patterns] ...
    (comp.lang.python)