Re: Problem with glob and filenames containing '[' and ']'



Mumia W. (reading news) wrote:
On 09/27/2006 06:33 AM, David Squire wrote:
Hi folks,

I'm having trouble using glob to find filenames that contain '[' and
']', even though I am escaping those meta-characters. Here is an example
script and output:

----

#!/usr/bin/perl

use strict;
use warnings;

use CGI::Deurl;

for my $EncodedFile (
'/damocles/documents/ENH1260/2006/2/Short
assignment/20331975_week9%5B1%5D.txt',
'/damocles/documents/ENH1260/2006/2/Short
assignment/20331975_week9.txt',

This creates two strings containing "Short \n assignment"

I think that's going to confuse glob big-time.

No. That's just an artifact of word-wrapping in your newsreader. See my
second, simpler, example.


DS
.



Relevant Pages

  • Re: Problem with glob and filenames containing [ and ]
    ... I'm having trouble using glob to find filenames that contain '[' and ... even though I am escaping those meta-characters. ... characters that are meta in glob; ... @CandidateOrigFiles: ...
    (comp.lang.perl.misc)
  • Re: Problem with glob and filenames containing [ and ]
    ... I'm having trouble using glob to find filenames that contain '[' and ... even though I am escaping those meta-characters. ... treating it as multiple patterns, ...
    (comp.lang.perl.misc)
  • Re: Problem with glob and filenames containing [ and ]
    ... I'm having trouble using glob to find filenames that contain '[' and ... even though I am escaping those meta-characters. ... script and output: ...
    (comp.lang.perl.misc)
  • Re: tclhttpd with utf-8
    ... it changed the data format from the non utf-8 format (that I was ... translation binary suppose to skip encoding translation? ... The problem is most likely the [glob] command, ... the filenames that cause trouble, then run your tclsh script with the ...
    (comp.lang.tcl)
  • Dumb glob question
    ... I've run into an issue with glob and matching filenames with brackets '' ...
    (comp.lang.python)