Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.lang.perl Subject: here documents Message-ID: <7192@star.cs.vu.nl> Date: 30 Jul 90 22:01:43 GMT Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Dept. of Computer Science, Amsterdam, The Netherlands Lines: 50 How about adding a `<<-' here document operator, which strips leading tabs and spaces off the lines forming the document? (And the line trailing the document.) Current practice in sh. Preserves indentation in the script. Currently the only workarounds I can think of are: 1) print "Newsgroups: $Newsgroups\n" . "Subject: $Subject\n" . "Summary: \n" . "Expires: \n" . "References:$References\n" . "Reply-To: $Name\@$Domainname ($Fullname)\n" . "Followup-To: \n" . "Distribution: $Distribution\n" . "Organization: $Organization\n" . "Keywords: \n" . "\n" . "In article $Message_ID,\n" . "\t$Orig_From writes:\n"; [Sic!] 2) sub here { $_[0] =~ s/((^|\n))[ \t]+/$1/g; $_[0] =~ s/((^|\n))\\/$1/g; $_[0]; } print &here(<<" EOF"); Newsgroups: $Newsgroups Subject: $Subject Summary: Expires: References:$References Reply-To: $Name\@$Domainname ($Fullname) Followup-To: Distribution: $Distribution Organization: $Organization Keywords: In article $Message_ID, \\\t$Orig_From writes: EOF BTW, I'd like `<<"\tEOF"' to work as well... [Remember, we're talking about _readability_ here, Randal! :-) ] -- "and with a sudden plop it lands on usenet. what is it? omigosh, it must[...] be a new user! quick kill it before it multiplies!" (Loren J. Miller)