[Linux-disciples] Perl: displaying the part of a match that failed
Stephen R Laniel
steve at laniels.org
Fri Jun 24 15:16:30 EDT 2005
On Fri, Jun 24, 2005 at 03:10:53PM -0400, Adam Rosi-Kessel wrote:
> Eh?
>
> print $_ unless (m/$block/);
>
> ??
It's not always true, but most of the time you should assume
that I've not made a drastically stupid mistake. *Most* of
the time.
The full grammar I'm writing down features things like
* a block is composed of multiple statements surrounded by
braces.
* a declaration is an element name followed by a block.
* a stylesheet is one or more declarations.
Then at the end, I do something like
$_ = join '', <>;
Now I'm parsing the whole stylesheet against the definition
of a stylesheet, and asking "Does this whole stylesheet
parse?" If it doesn't, I want to display the part that
didn't.
Is that any clearer?
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050624/8ae74abb/attachment.pgp
More information about the Linux-disciples
mailing list