469,270 Members | 1,762 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Perl - Parse UNC Path in a string variable

I have written a Perl script to modify some files over the network.
All PCs are Win2k. Most of the files reside on a share in the form of
\\server\share_name. Some of the files are on dirves in the form of
\\server\d$ and this is where my problem is.

My script prompts the user for the file name. It store the information
in a variable, parses it and then accesses it. If the file name
entered is \\server\share_name\filename, I do not have a problem. With
\\server\d$\filename however it simply fails. I have the logic to
convert \ to \\ which is why the former works
(\\server\share_name\filename). I tried escaping the $ (using \$) but
that did not work. I have tried various permutations and combinations
thus far and as a last option am sending my request to this newsgroup.

Kindly help.

Kevin.
Jul 19 '05 #1
5 8862
ke******@hotmail.com (Kevin Joseph) wrote in
news:54**************************@posting.google.c om:
I have written a Perl script to modify some files over the network.
All PCs are Win2k. Most of the files reside on a share in the form of
\\server\share_name. Some of the files are on dirves in the form of
\\server\d$ and this is where my problem is.

My script prompts the user for the file name. It store the information
in a variable, parses it and then accesses it. If the file name
entered is \\server\share_name\filename, I do not have a problem. With
\\server\d$\filename however it simply fails. I have the logic to
convert \ to \\ which is why the former works
(\\server\share_name\filename). I tried escaping the $ (using \$) but
that did not work. I have tried various permutations and combinations
thus far and as a last option am sending my request to this newsgroup.

Kindly help.


Kindly provide some useful information then. You indicate that you
'parse' the variable, that you have the 'logic' to convert \ to \\ etc
but never show code. We are not mind readers here. Please read

http://www.catb.org/~esr/faqs/smart-questions.html

to learn how to formulate your question so others can understand and help
you. Smart questions get answers. 'Does not work' doesn't.

--
A. Sinan Unur
1u**@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)

Jul 19 '05 #2
Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
or it is that you are trying to market some web page for dummies ? I
think I will just ignore your comment and wait for others to answer.

Kevin.
Jul 19 '05 #3

"Kevin Joseph" <ke******@hotmail.com> wrote in message
news:54**************************@posting.google.c om...

My script prompts the user for the file name. It store the information
in a variable, parses it and then accesses it. If the file name
entered is \\server\share_name\filename, I do not have a problem. With
\\server\d$\filename however it simply fails. I have the logic to
convert \ to \\ which is why the former works
(\\server\share_name\filename). I tried escaping the $ (using \$) but
that did not work. I have tried various permutations and combinations
thus far and as a last option am sending my request to this newsgroup.


Since you don't even post what the actual failure message is, let alone
working code that demonstrates the problem, you shouldn't be surprised
you're not getting any help.

Matt
Jul 19 '05 #4
Kevin Joseph <ke******@hotmail.com> wrote in comp.lang.perl.misc:
Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
or it is that you are trying to market some web page for dummies ? I
think I will just ignore your comment and wait for others to answer.


Good luck then.

Anno
Jul 19 '05 #5
Kevin Joseph wrote:
Is this a Perl newsgroup or a newsgroup for someone from KinderGarden
or it is that you are trying to market some web page for dummies ?
It was a serious request for more information in order to help you
solve your problem.
I have the logic to convert \ to \\ which is why the former works
(\\server\share_name\filename).
Could you show us your logic? It might need a bit of a rework.
I tried escaping the $ (using \$) but
that did not work. I have tried various permutations and combinations
thus far and as a last option am sending my request to this newsgroup.


Could you show us which permutations and combinations you've tried so far?
Kindly provide some useful information then. You indicate that you
'parse' the variable, that you have the 'logic' to convert \ to \\ etc
but never show code. We are not mind readers here.


In other words, show us the actual code you've tried so far.
-Joe
Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Xah Lee | last post: by
15 posts views Thread by Xah Lee | last post: by
1 post views Thread by Bill Corden | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
4 posts views Thread by Ignoramus6539 | last post: by
35 posts views Thread by lnatz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.