Richard A. Wells wrote:
> $Bill Luebkert wrote:
>> Richard A. Wells wrote:
>>   
>>> [...]
>>>
>>> The expression
>>>
>>>     $path_elem =~ s{(\s)}{\\$1}gio;
>>>     
>>
>> The /io is not needed/wanted.
>>   
> Right about the /i. That's conventional laziness on my part, as it is
> usually what I want, though it would be detrimental in this case.

Not detrimental - just confusing and unnecessary since there are no
printable characters in the RE.

> And I always use /o unless I'm intentionally interpolating in my
> pattern. Perhaps the regex engine is smart enough these days to infer
> that from the pattern, but it's another piece of conventional laziness.

I almost never use /o unless I'm trying to eke out the last µs from
some code and then it's meaningless if there is no variable to
interpolate in the RE which again confuses the reader.

>> I think it's easier to read this:
>>
>> my $win32 = $^O =~ /Win32/i;
>> my $path_elem = $ENV{CLEARCASE_PN};
>> $path_elem =~ s/ /\ /g if not $win32;
>>   
> Sure. It's a choice. But s/(\s)/\$1/g will handle other whitespace, too.

The problem stmt didn't include other WS and I would hope nobody would be
stupid enough to use any other WS in a filename - I refuse to even use a
space.  ;)

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to