On Wed, 2002-04-24 at 16:18, Michael Norris wrote:
> 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.
> 
<snip />

The here string (<<END stuff END) will correctly handle indents in Perl
6 (or so it is said), but Perl 5 does not do the Right Thing(tm).  For
cases like this I tend to write code that looks like this:

elsif ($string == 1) {
        $string = 
                "this is the first line\n"  .
                "this is the second line\n" .
                "etc.\n";
}

-- 
Today is Prickle-Prickle the 41st day of Discord in the YOLD 3168
P'tang!

Missile Address: 33:48:3.521N  84:23:34.786W


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

Reply via email to