in reply to Concatnate long statement
The same applies with string. Just type in the long string, and break it at your will.
Or, if you like, use the concatenation operator:my $str = "This string is not that long but I break it anyway becauase Perl allows me to do so and I just want to do it this way. But remember, there will be newlines inserted between lines";
Many Perl programmers, however, prefer to use here-doc syntax:my $str = "This string is not that long" . " but I break it anyway becauase" . " Perl allows me to do so and I just want to" . " do it this way. But remember, there will not" . " be newlines inserted between lines" . " unless I say it explicitly," . " like\n" . " this";
my $str = <<EOF; This string is not that long but I break it anyway becauase Perl allows me to do so and I just want to do it this way. But remember, there will be newlines inserted between lines. I can also put $some ($variables) here. EOF
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Concatnate long statement
by varian (Chaplain) on Jul 04, 2007 at 07:16 UTC |