Michael G Schwern wrote:
> 
> See, I never understood this.  If you're indenting the terminator, it
> implies you're also indenting the here-doc text.  I mean, this doesn't
> make any sense:
> 
> { { { {
>         print <<TAG;
> I don't know what their
> gripe is.  A critic is
> simply someone paid to
> render opinions glibly.
>                 TAG
> } } } }

Sure it does, as Eric's shown:

   if ( $this < $that )
       while (<DATABASE>) {
           chomp;
           $record = quotemeta $_;
           if ( $record ) {
                ($rec, $name, $dob, $address, $joindate, $books)
                     = split /\s+/, $record;
                 print <<END_OF_RECORD;
        Current record: $rec

Name:    $name
DOB:     $dob
Address: $address

The above person has been a member of the Perl 6 Book of the Month
club since $joindate, purchasing a total of $books books.
                 END_OF_RECORD
                 push @records, $record;
           }
       }
   } 


> So indenting the terminator and indenting the text are linked.  If you
> do one, you want to do the other.

As I and many others have said, that's not necessarily true. I like all
my code to line up, braces, parens, and all. It enhances readability,
and is easier to scan.

Anyways, it seems both your and my needs could be met if we simply added
a <<< operator that does what you want. Otherwise we're forced to choose
between two useful alternatives that are both valid. I could see using
both your and "my" way in many different situations, so we should make
them coexistant, not mutually exclusive.

-Nate

Reply via email to