glob problem

J

jtbutler78

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
 
J

jtbutler78

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.
 
B

Brian McCauley

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()
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top