in reply to Re: Shell v Perl
in thread Shell v Perl, here-doc as stdin
If you have an empty line before the END, that empty line will get printed, which may not be what you want. You are right that it must match the first tag exactly though, if you say print <<"END";, the ending line must have ONLY 'END' in it, if you have extra spaces (even ones you may not be able to see at the end of the line), it won't work. This advice is doubly serious when you write things like this:
sub print_stuff { print <<"END"; some stuff some more stuff END }
This example doesn't work because your starting tag is "END" but your ending tag is " END". Leaving a blank line before the END isn't something I'm planning to start doing though, if you are using the here-docs right, you don't need it, if you need to always leave a blank line, then you are probably doing something wrong.
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Shell v Perl
by Coplan (Pilgrim) on Apr 10, 2003 at 17:28 UTC | |
by Tomte (Priest) on Apr 11, 2003 at 08:01 UTC |