On Wed, 27 Jul 2011 15:19:56 -0400
Tim Lewis <[email protected]> wrote:
> I am attempting to add a line feed to the end of each line. When I do this, a
> carriage return is also added. My code lines are:
>
> $currentLine = $currentLine . "\x{0A}";
> $finalOutput = $finalOutput . $currentLine;
>
> There has to be a way to do this. Also, is there a better way to
> concatentate?
Yes, there is - see the ".=" operator:
<CODE>
$current_line .= "\x{0A}";
</CODE>
And this code should not add a carriage return. so you're doing something else
wrong. Also, in Perl the customary style is to use
$word_separated_by_underscore instead of $camelCase.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
First stop for Perl beginners - http://perl-begin.org/
Better be a tail for the lions, than the head of the jackals.
— Pirkei Avot, 4 15
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/