ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: [perl #30966] Windows PATH variable pieces can be in quotes
by Dave Mitchell other posts by this author
Sep 5 2004 8:41PM messages near this date
[perl #30966] Windows PATH variable pieces can be in quotes | Smoke [5.9.2] 23197 FAIL(Fc) bsd/os 4.1 (i386/1 cpu)
On Fri, Aug 06, 2004 at 04:34:56PM -0000, Warren Dodge wrote:
>  I just encountered a problem in a script that parses 
>  the PATH variable and checks to make sure each entry 
>  has a directory.
>  
>  It turns out that some program entered something like this
>  as a PATH entry.   "C:\PATH\BIN"
>  
>  The quotes were included. I tested this at a CMD prompt 
>  and indeed it does work as expected. The quotes are shown in a 
>  set path  command.
>  
>  It seems the -d operator in perl doesn't handle this properly
>  
>  if ( -d "\"C:/temp\"" )
>  {
>    print "OK1\n";
>  }
>  else
>  {
>    print "BAD1\n";
>  }
>  if ( -d "C:/temp" )
>  {
>    print "OK2\n";
>  }
>  else
>  {
>    print "BAD2\n";
>  }
>  
>  So I wanted to let you know so perhaps the low level stuff 
>  could be enhanced.

Thanks for the report.

On reflection, I don't think the basic OS functions should be messed with
the emiulate the particular quirks associated with teh $PATH environment
variable.

Dave.

-- 
Little fly, thy summer's play my thoughtless hand
has terminated with extreme prejudice.
        (with apologies to William Blake)
Thread:
Warren Dodge (via RT)
Dave Mitchell

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved