develooper Front page | perl.beginners | Postings from October 2009

The Perl question of the here document

Thread Next
October 21, 2009 04:04
The Perl question of the here document
Message ID:
Dear list:

  Sorry to distrub all .

            When I learned  Perl on the book called "Perl by example 4th
Chinese Edition ", I found there was an  error on this book .

           There had  a perl script  writted by this :
                  print << 'END';
                     echo Today is

               The book said the  script would display this :
                                Today is
                                  Fir Oct 27 12:48:36 PDT 2007

                 But when I put it on my OS called CentOS 5.3  and run it
,the output  like this :
                              echo Today is

                    I also write it like this :
                           $now =`date`;
                            print <<END;
                              Today is $now

                     This script will be displayed t this "Today is   Wed
Oct 18:38 CST 2009"

                    Is it an  error of the book ?Or Can the Perl would
execute the Shell command in  here document with the  signal quotes?

                      Thanks in advance ~~~~

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About