SPUG: A little style question....

Stephen Nickels snickels at u.washington.edu
Tue Sep 19 17:25:51 CDT 2000

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?

$output =<<TEXT;
Blah blah blah $variable blah blah

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

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/

More information about the spug-list mailing list