SPUG: Re: A little style question....

John Cokos jcokos at ccs.net
Tue Sep 19 18:43:38 CDT 2000


Use this ....

$output = qq~
   adfljdfjlds
   aldfjldjfldjfds
~;

instead of a heredoc.

That way, a code munger would work fine.....


========================================
  John Cokos, President / CEO: iWeb Inc.
  http://www.iwebsys.com
  jcokos at ccs.net
========================================

----- Original Message ----- 
From: "Stephen Nickels" <snickels at u.washington.edu>
To: <spug-list at pm.org>
Sent: Tuesday, September 19, 2000 3:25 PM
Subject: SPUG: A little style question....


> I've got a quasi-perl, quasi-programming-style question for y'all.
> I've gone back and forth with a friend of mine on this one, so I thought
> I'd get some more professional opinions. My question is: here docs, good
> or bad?
> 
> (aka:
> $output =<<TEXT;
> Blah blah blah $variable blah blah
> TEXT
> )
> 
> I consider them a very helpful part of programming, especially web
> scripting, allowing you to either output or save to an output variable
> large pieces of formatted and interpolated text; they're great for
> outputting html. My friend, however, considers them the spawn of the
> underworld, believing that all good programs should work exactly the same
> after having all groups of spaces and/or newlines replaced with a single
> space. (aka, $code =~ s/[\s\n]+/ /g;) Line-delimited things like here docs
> break this rule of his quite severly.
> 
> So what are some of the general opinions of perl-mongers out there? Are
> here docs a useful addition to programming languages, or are they bad
> form?
> 
> Thanks a lot!
> 
> 
> 
> "When once you have tasted flight, you will forever walk
> the Earth with your eyes turned skyward, for there you have been,
> and there you will always long to return"
> -Leonardo da Vinci
> 
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      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://www.halcyon.com/spug/
> 
> 
> 


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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://www.halcyon.com/spug/





More information about the spug-list mailing list