here documents 
Author Message
 here documents

It appears that the operator << now (perl5) only performs the left shift
operation and is no longer a delimiter for a here document.  Is this true?

No big deal, since calling a shell script with a here document in it
from perl is trivial.

Just wanted to know, and point this out as a difference to what is described
in the camel book and perl5.

--
Wade Scherer

Image Understanding Laboratory
Martin Marietta  Astronautics Group
(303)-977-0479



Wed, 16 Jul 1997 02:03:01 GMT  
 here documents
: It appears that the operator << now (perl5) only performs the left shift
: operation and is no longer a delimiter for a here document.  Is this true?

: No big deal, since calling a shell script with a here document in it
: from perl is trivial.

: Just wanted to know, and point this out as a difference to what is described
: in the camel book and perl5.

% perl5

print <<EOM ;
That
is
not true
EOM

gives me this

That
is
not true

Paul



Wed, 16 Jul 1997 18:49:32 GMT  
 here documents

Quote:

>It appears that the operator << now (perl5) only performs the left shift
>operation and is no longer a delimiter for a here document.  Is this true?

No, it isn't.  Look in the perldata man page for details.

#!/usr/local/bin/perl

print <<DELIM;

    This is a "here" document, modeled after the similar shell construct.

DELIM
__END__
--
Rodger Anderson



Thu, 17 Jul 1997 06:17:18 GMT  
 here documents

Wade> It appears that the operator << now (perl5) only performs the left shift
Wade> operation and is no longer a delimiter for a here document.  Is this true?

Wade> No big deal, since calling a shell script with a here document in it
Wade> from perl is trivial.

Wade> Just wanted to know, and point this out as a difference to what is described
Wade> in the camel book and perl5.

Huh?

        $ perl
        print <<EOF;
        the version is $].
        EOF
        ^D
        the version is 5.000.
        $

What *exactly* do you mean?  What piece of code works differently?

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)

--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying

Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>



Thu, 17 Jul 1997 08:12:14 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. here document question

2. comparison of 2 SGML documents

3. using here document in perl's system command

4. PERLTRAP - "here document" interpretation

5. Perl module to retrieve a document and send back to a browser

6. Name of calling html-document

7. Document access monitoring

8. how to return document status without using CGI.pm

9. Perl and document conversion to HTML ...SOLUTION?

10. Perl and document conversion to HTML

11. Join a document to an Email

12. using here document with eval fails

 

 
Powered by phpBB® Forum Software