On 16 Feb 2004, at 6:52 PM, Daniel Macks wrote:


On Thu, Feb 12, 2004 at 06:14:10PM +1100, Rohan Lloyd wrote:
[a *huge* snip...we're now talking about a patch for Services.pm]

Okay, looking good. Question:

  - If "#!" strip leading whitespace on first line only
  - Otherwise, unfold lines and strip leading whitespace on all lines.

This latter part is implemented by:


+               # Strip any leading white space on each line
+               $script =~ s/^\s*//mg;
+               # Unfold multiline commands into one line
+               $script =~ s/\s*\\\n\s*/ /g;

Given that the first of these does what the comment says, won't there
never be any \s after a \n?

Well spotted.


When I originally wrote the 2nd regex, I was not stripping leading whitespace, so the "\s*" was required. However, as you point out, it is redundant given the 1st regex.

--
Rohan Lloyd



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to