|
NAMEHTML::Chunks::Super - Chunks with superpowersVERSION1.0DESCRIPTIONThe mutant spawn of HTML::Chunks, this module has all of the abilities of its parent plus additional emerging superpowers. The first enhancement to be added is conditional processing. For full chunk documentation, please see HTML:::Chunks. Only HTML::Chunks::Super enhancements will be discussed here.CONDITIONAL PROCESSINGWhile conditional processing does indeed blur the lines between layout/markup and actual programming logic, it can be very powerful when used sparingly and appropriately. We urge you to use this ability only for simple display logic, keeping the chunk side of life mostly pure and uncomplicated. With great power comes great responsibility. :-)That warning aside, here is the extended chunk syntax: <!-- IF condition --> normal chunk stuff <!-- ELSIF condition --> more chunks <!-- ELSE --> chunky chunk of chunks <!-- ENDIF --> The "condition" can by most any valid perl expression and will usually reference one or more chunk data elements. See the HTML::Chunks documentation for a full descripton of data elements, but as a refresher, they look like "##this##" and refer to dynamic data that is merged into a chunk at run-time. For use in conditionals, you can treat them as read-only scalars. Some example conditions
You get the idea. Most comparisons and conditions that are possible in straight perl will be possible here as well. CREDITSCreated, developed and maintained by Mark W Blythe and Dave Balmer, Jr. Contact dbalmer@cpan.org or mblythe@cpan.org for comments or questions.LICENSE(C)2001-2009 Mark W Blythe and Dave Balmer Jr, all rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |