Re: Ignorance is NOT bliss, help!

[email protected]
Newsgroups perl.recdescent
Message-ID <[email protected]>

Thanks Randal.  Yes, that was an incredibly stupid logic mistake ... and I have
hung my head in shame! :-)  Unforturnately I now have what is probably another
fine example of ignorance (if not stupidity).  I stuck in some terminating \n's
in the array elements to simulate reading the lines out of a file.  In my
grammar I've got the following rule:

cronSeg: TimeRange(s /;/) EOL {print "Found conSeg\n"}

with EOL being defined as /$/.  When the grammar is run with the examples given
it fails to match and is failing on the EOL terminal.  In fact it fails whether
there's a terminating \n or not.
At the risk of looking stupid once again what the heck am I dong wrong now?

Ken




[email protected] (Randal L. Schwartz) on 08/18/2001 05:28:20 PM

To:   [email protected]
cc:    (bcc: Ken LaCrosse/FOL/CDI/CHI/US)
Subject:  Re: Ignorance is NOT bliss, help!



>>>>> "Ken" == Ken Lacrosse <[email protected]> writes:

Ken> Could anyone relieve my ignorance and clue me in as to why the following
grammar
Ken> won't parse the second test line (0810-0850) when the first line
(0800-0850)
Ken> parses fine?

..

Ken>                return "$item[1]$item[3] - $item[5]$item[7]"
Ken>                     if ($item[1] > 0 and $item[1] < 24 and $item[5] > 0 and
Ken> $item[5] < 24 and
Ken>                          $item[3] > 0 and $item[3] < 60 and $item[7] > 0
and
Ken> $item[7] < 60)


It's the ol' "> is not >=" problem. :)  >=0 will do what you want.

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