Re: Windows paths in glob



Dmitry wrote:

Question: is there any way to use the same path string with glob and with the rest of Perl,
without having to convert them back and forth?

Is a simple conversion acceptable?

If you put double quotes aroudn the path *in* the string for glob, then
it'll work.

($\, $,) = ("\n", "\t");
chdir 'c:/temp';
foreach('C:/Documents and Settings', 'C:\\Documents and Settings') {
print $_, glob(qq("$_")), -d $_ || 0;
}

Result:

C:/Documents and Settings C:/Documents and Settings 1
C:\Documents and Settings C:./Documents and Settings 1

Well, ok... the response of glob to a backslash *is* weird. But at
least, it seems to work.

--
Bart.
.



Relevant Pages

  • Re: Deployment + Vista
    ... The problem is it's connection string is always hard ... Server settings form. ... guess it's a good thing I do not use that for settings. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Calculations on activex components using IUSR
    ... After doing the calculations on my values the value is converted to string ... When converting the value to string it contains a comma instead of period. ... and doesn't change its locale settings ...
    (microsoft.public.vb.com)
  • Re: Whats best practice using dynamic connections strings
    ... the string from the Settings file to get it from this other mechanism. ... I felt this was a shortcoming of the Data Designer, ... where it will read the connection string from. ...
    (microsoft.public.vsnet.general)
  • Re: tables
    ... bypass excel altogether and have the data within the application ... Just because you were using Excel before, that doesn't mean that the data needs to be in any sort of Excel-like object when it's entirely contained within the application. ... As far as saving goes, you have a variety of options, but one of the simplest is to put the data in your applications settings and use the Properties.Settings.Default class to read and write them. ... The array of doubles won't automatically serialize, so probably the best thing to do there is write some custom code that writes to a StringWriter based on a StringBuilder, and then save the resulting string in the application settings. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: VB6 and Windows Media Player
    ... within the My Music Folder. ... Private Declare Function ShellExecute Lib "shell32.dll" Alias ... "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal ... the folder Documents and Settings eg:- C:\Documents and Settings? ...
    (microsoft.public.vb.general.discussion)