Re: <reject> and whitespace

[email protected] (Aaron J Mackey)
Newsgroups perl.recdescent
Message-ID <Pine.OSF.4.33.0104242237170.19590-100000@alpha10.bioch.virginia.edu>
On 24 Apr 2001, Randal L. Schwartz wrote:

> >>>>> "Aaron" == Aaron J Mackey <[email protected]> writes:
>
> Aaron> line: word // { $thiscolumn == 22} word # skipping whitespace is automatic
> Aaron> 					# but I require the second word to
> Aaron> 					# start at column 22, hence I need
> Aaron> 					# to skip the whitespace which
> Aaron> 					# preceeds it
>
> Well, // is not ''.  I'd use that instead.  // means "match whatever
> the most recent successful match matched".  This isn't split. :)

Hmm, well then the documentation is quite confusing:

  Note that $thiscolumn reports the column number before any whitespace
  that might be skipped before reading a token. Hence if you wish to know
  where a token started (and ended) use something like this:

             rule: token1 token2 startcol token3 endcol token4
                             { print "token3: columns $item[3] to $item[5]"; }

             startcol: // { $thiscolumn }    # NEED THE // TO STEP PAST TOKEN SEP
             endcol:      { $prevcolumn }

My // is just Damian's startcol "inlined".

-Aaron
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.