Concatenation will do what you want...

$string = "This is the text I want\n".
           "But I also want this text on next line.\n";


> > Ok,
> >
> > But what if I'm doing an elsif and my code is indented such as:
> >     elsif ($string == 1) {
> >         $string = This is the text I want
> >                   But I also want this text on next line.
> >
> > Is there a way to ignore the white space before the "But I
> > also want this text on the next line?"  Otherwise I would
> > have to do the following:
> >
> > elsif ($string == 1) {
> >         $string =
> > This is the text I want.
> > But I also want this text on the next line.
> >
> >
> > This may be trivial, but I'm just trying to make my code look
> > some what neat.
> >
> > Thanks for the help.
> >
> >
> > --- Nikola Janceski <[EMAIL PROTECTED]> wrote:
> > >try this:
> > >$string = "This is the text I want
> > >But I also want this text on the next line
> > >how can I write this code so that it looks
> > >nicer than this.\n";
> > >
> > >who said quotes can't span multiple lines?
> > >
> > >or this:
> > >$string =<<END
> > >This is the text I want
> > >But I also want this text on the next line
> > >how can I write this code so that it looks
> > >nicer than this.
> > >END
> > >
> > >
> > >> -----Original Message-----
> > >> From: Michael Norris [mailto:[EMAIL PROTECTED]]
> > >> Sent: Wednesday, April 24, 2002 3:55 PM
> > >> To: [EMAIL PROTECTED]
> > >> Subject: Setting a Variable to String with \n?
> > >>
> > >>
> > >> Hello,
> > >>
> > >> I want to set a variable to a string with the new line
> > >> character (\n) separating the text I want onto new lines.
> > >>
> > >> For example,
> > >> $string = "This is the text I want\nBut I also want this text
> > >> on the next line\nhow can I write this code so that it looks
> > >> nicer than this.
> > >>
> > >> How can I write that code without wrapping the text making my
> > >> script messy like it is above?
> > >>
> > >> Thank you


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to