[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Is this a bug?



     However, there is a way to use the \tHELLO as the here document 
     terminator (which I found by reading the documentation). That is to 
     quote the terminating string. If you use single quotes, the here 
     document is logically enclosed in single quotes. Double quotes double 
     quote the here document. This naturally affects the interpolation of 
     variables. An unquoted terminator is implicitly double quoted. 
     
     And this is general Perl behavior...
     
     I like the ability to indent my here document terminator...
     
     Michael


______________________________ Reply Separator _________________________________
Subject: [MacPerl] Is this a bug?
Author:  rpyle@tiac.net (Robert Pyle) at smtpgw
Date:    02/22/97 08:23 PM


I've been reading Randal Schwartz's Unix Review column no. 12, which is 
about "here documents".
     
Here's a short script (saved in file t.pl):
     
#! perl -w
        print <<HELLO;
        hi
        HELLO
     
Seems like this should be equivalent to
     
#! perl -w
        print "hi\n";
     
but when I try to run it, MacPerl 5.1.3r2 tells me
     
# Can't find string terminator "HELLO" anywhere before EOF. 
File 'develop:Mac_Perl:mycode:t.pl'; Line 2
     
Is there some (good) reason this doesn't work on a Mac?
     
Thanks for any insight.
     
Bob Pyle, Cambridge, MA, USA