in reply to Trubs with HERE docs

You can find more information in perlfaq4, specifically "Why don't my <<HERE documents work?". There's 3 or so solutions given on that page.

I do understand that HERE docs will be dramatically fixed in Perl 6 to allow indententation. For the time, however, I've been using q or qq as a better replacement for HERE docs, since you don't have to worry about having the end point flush on the left margin. EG:

sub help { print qq( The help information goes here! ) die(); }
Alternatively, particularly if you have a lot of documentation that you'll present to the user through the perl code, you may want to look into a templating solution to remove the text of those documents from the code and into external files, but that's only a suggestion.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important

Replies are listed 'Best First'.
Re: Re: Trubs with HERE docs
by tachyon (Chancellor) on Sep 05, 2001 at 17:39 UTC

    The only problem with this is that you get an unwanted leading "\n" on the string ( as well as the leading whitespace common to indented herepages ).

    The good news is that this issue will be fixed in Perl 6 with indented herepage tokens allowed and automatic whitespace stripping.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Well, if you are assigning the value rather than printing it directly you can do this ugliness:
      (my $k= q( Blah Blah Blah Blah Blah Blah )) =~ s/^\s+|(?s:\s+$)//gm; print "<<$k>>\n";

      *shame*

      --
      $you = new YOU;
      honk() if $you->love(perl)