glob problem

Discussion in 'Perl Misc' started by jtbutler78@comcast.net, May 17, 2006.

  1. Guest

    I am having an issue with glob but I am not sure what the deal is.
    Here is my code:
    $history = "\\\\server\\share\$\\folder";
    $look_in_here = "$history\\*.*";
    @allfiles = glob("$look_in_here") or die $!;
    print @allfiles; - gives me literally "\serversharefolder"

    but if I say this for $history = "k:\\folder"; the glob seems to work
    ok. I dont want to map drives on this server. Is there a way to get
    the glob to read the path name

    thanks

    Jim
    , May 17, 2006
    #1
    1. Advertising

  2. Guest

    I was able to get it going using chdir($history) or die $!; - If anyone
    else has any other ways to do I would be interested in learning.
    , May 17, 2006
    #2
    1. Advertising

  3. wrote:
    > I was able to get it going using chdir($history) or die $!; - If anyone
    > else has any other ways to do I would be interested in learning.


    glob() simulates Unix shell globbing. This means backslash is meta.

    If you simply want to get the whole of a directoryt use the builtin
    opendir()/readdir() or File::Slurp::read_dir()
    Brian McCauley, May 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Georgy Pruss
    Replies:
    15
    Views:
    723
    Tim Roberts
    Dec 1, 2003
  2. Tim Peters
    Replies:
    1
    Views:
    356
    Duncan Booth
    Dec 1, 2003
  3. Sean Berry

    Question about glob.glob <--newbie

    Sean Berry, May 4, 2004, in forum: Python
    Replies:
    3
    Views:
    345
    David M. Cooke
    May 4, 2004
  4. Elbert Lev

    glob.glob unicode bug or feature

    Elbert Lev, Jul 31, 2004, in forum: Python
    Replies:
    5
    Views:
    392
    Neil Hodgson
    Aug 2, 2004
  5. lameck kassana
    Replies:
    0
    Views:
    290
    lameck kassana
    Feb 26, 2009
Loading...

Share This Page