[TriLUG] was more uselessinfo/commentary, now more percise perl question.

Andrew Perrin andrew_perrin at unc.edu
Thu Mar 21 14:58:14 EST 2002


On 21 Mar 2002, Tanner Lovelace wrote:

> On Thu, 2002-03-21 at 14:38, Andrew Perrin wrote:
> 
> > print <<HERE;
> > All of this information will be printed to STDOUT.
> > Variables like $i will be interpolated.
> > Perl code will not be executed. die "danger Will Robinson!" will only be
> > printed, not executed.
> > HERE
> 
> Also, I believe, and someone correct me if I'm wrong, there shouldn't
> be any spaces between << and HERE.

Generally true; however, if you really want to you can do:
print <<'   THERE';
foobar
   THERE

Note the single-quotes around the beginning '   THERE' and that the spaces
*are* significant: three spaces between the opening ' and THERE, three
spaces between the left margin and THERE at the end.

----------------------------------------------------------------------
Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
 Assistant Professor of Sociology, U of North Carolina, Chapel Hill
      269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA







More information about the TriLUG mailing list