SPUG: Re: Filter::Simple by J.P. tomorrow too

Richard Anderson richard at richard-anderson.org
Tue Apr 16 09:40:03 CDT 2002


What's wrong with this (paraphrased from my memory of the Camel book section
on here docs, may not have the syntax right):

($test = <<END ) =~ s/^\s+//;
                 This is
                  my indented
                  here document.
END

Cheers,
Richard
richard at richard-anderson.org
www.richard-anderson.org
www.raycosoft.com
----- Original Message -----
From: "Tim Maher" <tim at consultix-inc.com>
To: <spug-list at pm.org>
Sent: Monday, April 15, 2002 5:49 PM
Subject: SPUG: Filter::Simple by J.P. tomorrow too


> --->SPUG alert<---
>
> "El JoPe Magnifico" <jope at jope.net>, otherwise known as JP, has
> volunteered to talk about the use of the Damianiacal "Filter::Simple"
> module to allow indentation within Here-Documents (as in the Korn and
> Bash shells).
>
> As JP himself puts it:
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> Normal Perl here-doc syntax is like this:
>
>   ## Consider this column 0.
>       ## Consider this the current indentation level.
>       do_something();
>       print <<END_MARKER;
>   some text
>   END_MARKER
>       do_something_else();
>
> The here'd text and end-marker breaks up code indentation.
>
> In bash, however, you can prepend a hyphen to your end-marker,
> to indicate that leading tabs should be stripped from following
> lines up to and including the end-marker, e.g.:
>
>   do_something
>   cat - <<-END_MARKER
>       some text
>       END_MARKER
>   do_something_else
>
> This allows you to maintain proper indentation.  My talk will be an
> attempt to grok this same behavior with Filter::Simple.  Which in fact,
> may not be possible, but along the way to discovering this, much is
> illustrated.  =)
>
>   -jp
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
>
> There's still room for additional talks on tomorrow's agenda, so let me
> know if YOU (yes *you*, you chronic Lurker you) are willing to share your
> knowledge with your fellow SPUGsters.
>
>
*===========================================================================
===*
> |  Dr. Tim Maher, CEO, Consultix          (206) 781-UNIX/8649;  ask for
FAX#   |
> |  tim at consultix-inc.com   teachmeperl.com  teachmeunix.com
teachmelinux.net  |
> | APR: Shell; Int/OO Perl; Perl DataBase;  JUNE: Basic UNIX, Perl  JULY:
Perl  |
>
*---------------------------------------------------------------------------
---*
> | NEW Seminar Series!  "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle,
7/15-18  |
> | Adv. OOP  *  Adv. Module Implementation Techniques  *  Programming in
Perl 6 |
>
*===========================================================================
===*
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
>      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list