Re: <reject> and whitespace

[email protected] ((Randal L. Schwartz))
Newsgroups perl.recdescent
Message-ID <[email protected]>
>>>>> "Aaron" == Aaron J Mackey <[email protected]> writes:

Aaron> On 24 Apr 2001, Randal L. Schwartz wrote:

>> I'd state that in the positive instead:
>> 
>> line: word { $thiscolumn == 22 } word # skipping whitespace is automatic

Aaron> Ahh, but doesn't that need to be:

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. :)

Aaron> And of course there's the fact that 1 == 0 is not undef, and so this
Aaron> doesn't actually fail/reject (the GOTCHYA's Damian sprinkles throughout
Aaron> the docs are stuck in my head).

Ooops.  Then make this:

line: word '' { $thiscolumn == 22 || undef } word

Or using your reject:

line: word '' <reject: $thiscolumn != 22> word

I could live with either one.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
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.