Professional Web Applications Themes

here-doents - PERL Beginners

I have been learning perl from a bit of an old book (5.6) but the current 5.8 info I have found on the web shows the same method for using here-doents, so why doesn't this work? #!/usr/bin/perl -w print<<EOF; blah blah blah. this is a here-doent. EOF I keep getting "Can't find string terminator "EOF" anywhere before EOF at ./eof.plx line 2." Thanks...

  1. #1

    Default here-doents

    I have been learning perl from a bit of an old book (5.6) but the
    current 5.8 info I have found on the web shows the same method for using
    here-doents, so why doesn't this work?

    #!/usr/bin/perl -w
    print<<EOF;
    blah blah blah. this is a here-doent.
    EOF

    I keep getting "Can't find string terminator "EOF" anywhere before EOF
    at ./eof.plx line 2."

    Thanks

    Sean Sullivan Guest

  2. #2

    Default Re: here-doents

    Sean Sullivan wrote:
    > I have been learning perl from a bit of an old book (5.6) but the
    > current 5.8 info I have found on the web shows the same method for using
    > here-doents, so why doesn't this work?
    >
    > #!/usr/bin/perl -w
    > print<<EOF;
    > blah blah blah. this is a here-doent.
    > EOF
    >
    > I keep getting "Can't find string terminator "EOF" anywhere before EOF
    > at ./eof.plx line 2."
    >
    > Thanks
    >
    Got it. It needed another line at the end:

    #!/usr/bin/perl -w
    print<<"EOF";
    blah blah blah. this is a here-doent
    EOF
    print'nothing more', "\n";

    Not sure why that is though, just that it works. So if anyone can tell
    me I'd appreciate it.

    Sean

    Sean Sullivan Guest

  3. #3

    Smile Re: here-doents

    Quote Originally Posted by Sean Sullivan View Post
    Sean Sullivan wrote:

    Got it. It needed another line at the end:

    #!/usr/bin/perl -w
    print<<"EOF";
    blah blah blah. this is a here-doent
    EOF
    print'nothing more', "\n";

    Not sure why that is though, just that it works. So if anyone can tell
    me I'd appreciate it.

    Sean
    Looks like you don't need the additional line after all. Had trouble with this myself. The EOF line "has to sit on its own line". I read that part in the manual. What the manual doesn't tell you is that EOF is not "on its own line" until you hit enter (or carriage-return to the next line in your editor). Just figured it out by trial and error, but I hope this helps. :-)
    Randall J. Currie Guest

Similar Threads

  1. Opening doents by DDE
    By Thomas_Frommelt@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 1
    Last Post: November 6th, 01:20 PM
  2. Coverting Indesign 2.0 doents to Microsoft Word xp doents
    By Pam_Sepesi@adobeforums.com in forum Adobe Indesign Windows
    Replies: 3
    Last Post: May 3rd, 02:43 AM
  3. Desperate to convert Word doents into PDF doents
    By R_Vaughan@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 17
    Last Post: April 19th, 06:24 PM
  4. Doents
    By Jeff Cochran in forum ASP Database
    Replies: 0
    Last Post: January 15th, 01:53 PM
  5. accessing doents in "My Doents"
    By David Candy in forum Windows XP/2000/ME
    Replies: 3
    Last Post: July 17th, 01:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139