From: bagman on 13 Nov 2009 20:32 I'm not that familiar with Perl but am trying to enter a couple of <br> into a perl script. It needs to go where this appears. if ($arg eq 'only') { print <<END; I want to enter a couple of line breaks before the routine ends. I've tried to enter it after the { using <br><br> and "<br><br>"; I've tried to use it using print "<br><br>"; with no luck. I've tried to enter it after the print command in various ways with no luck. Can someone tell me the correct syntax to enter a couple of line breaks in the above code? Thanks.
From: sreservoir on 13 Nov 2009 20:52 bagman wrote: > I'm not that familiar with Perl but am trying to enter a couple of > <br> into a perl script. It needs to go where this appears. > > if ($arg eq 'only') { > print <<END; > > I want to enter a couple of line breaks before the routine ends. > I've tried to enter it after the { using <br><br> and "<br><br>"; > I've tried to use it using print "<br><br>"; with no luck. > > I've tried to enter it after the print command in various ways with no > luck. Can someone tell me the correct syntax to enter a couple of line > breaks in the above code? Thanks. print "\n\n"; perhaps? -- "Six by nine. Forty two." "That's it. That's all there is." "I always thought something was fundamentally wrong with the universe"
From: Jim Gibson on 13 Nov 2009 21:00 In article <aj1sf59htl6b9tnv5opvoqo5c03jkg51uc(a)4ax.com>, bagman <elopppoer(a)yughi.net> wrote: > I'm not that familiar with Perl but am trying to enter a couple of > <br> into a perl script. It needs to go where this appears. > > if ($arg eq 'only') { > print <<END; > > I want to enter a couple of line breaks before the routine ends. > I've tried to enter it after the { using <br><br> and "<br><br>"; > I've tried to use it using print "<br><br>"; with no luck. > > I've tried to enter it after the print command in various ways with no > luck. Can someone tell me the correct syntax to enter a couple of line > breaks in the above code? Thanks. The '<<END;' is a "here" document that generates a string starting with the next line and continuing until an 'END' token appearing by itself at the beginning of a line. It would have helped if you had shown us the entire string or, better still, a complete program demonstrating the problem. You should be able to add anything to be printed verbatim anywhere between the 'print <<END'; line and the terminating 'END' line: if ($arg eq 'only') { print <<END; <br><br> ....whatever else needs to be printed... END } -- Jim Gibson
From: Ben Morrow on 13 Nov 2009 21:00 Quoth bagman <elopppoer(a)yughi.net>: > I'm not that familiar with Perl but am trying to enter a couple of > <br> into a perl script. It needs to go where this appears. '<br>' is not valid Perl. I *suspect* you mean that you want to insert the <br> into a HTML document the Perl program is supposed to print out, but if so you need to be clear that is what you are doing. Getting confused about which parts of the program are 'Perl code to be run' and which parts are 'HTML data to be copied around' will make it impossible for you to change anything sensibly. > if ($arg eq 'only') { > print <<END; > > I want to enter a couple of line breaks before the routine ends. > I've tried to enter it after the { using <br><br> and "<br><br>"; > I've tried to use it using print "<br><br>"; with no luck. Please post a *short* *complete* script we can all run that demonstrates your problem. You may wish to read the Posting Guidelines. Ben
From: Tad McClellan on 13 Nov 2009 21:08 bagman <elopppoer(a)yughi.net> wrote: > am trying to enter a couple of ><br> into a perl script. print "<br><br"; > I want to enter a couple of line breaks print "\n\n"; -- Tad McClellan email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
|
Next
|
Last
Pages: 1 2 3 Prev: Please help with processing flat file Next: FAQ 1.14 What is a JAPH? |