On Aug 13, ERIC Lawson - x52010 said:

>It does change every instance (except the first) of \n%A in the scalar
>into a semicolon, given a scalar containing, e.g.,

Basically, it scrunches

%A this
%A that
%A those

into

%A this;that;those

>My concern is with how it works...not understanding how, I'm expecting
>surprises when I attempt to use the same tactic in other contexts.

The inversion is probably what scares you.

  1 while EXPR;

is a technique to evaluate EXPR until it becomes false.  You could write
it as

  while (EXPR) { 1 }

or

  while (1) {
    last if !EXPR;
  }

The point is, the regex advances PAST the next %A, so in the text

%A this
%A that
%A those

just executing the regex

  s/(%A .*)\n%A /$1;/g

would result in

%A this;that
%A those

However, I have a solution, that I'll be posting in a moment.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to