in reply to joining string content
Given your code, that's impossible.
my $string = (+book +dog +cat);
Given your code, Perl sees:
my $string = 'book' + 'dog' + 'cat';
... which makes Perl calculate the sum of book, dog and cat, which is zero, because (non-number-looking) strings evaluate to 0 in Perl.
Can you show us a complete, runnable example of the code and data you have that replicates your problem?
I think you want something like Text::CSV_XS, if your goal is to produce a CSV file, for example for Excel.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: joining string content
by joyfedl (Acolyte) on Jun 24, 2025 at 09:04 UTC | |
by Corion (Patriarch) on Jun 24, 2025 at 09:22 UTC | |
by joyfedl (Acolyte) on Jun 24, 2025 at 12:53 UTC | |
by Corion (Patriarch) on Jun 24, 2025 at 13:10 UTC | |
by joyfedl (Acolyte) on Jun 24, 2025 at 13:23 UTC | |
by tybalt89 (Monsignor) on Jun 24, 2025 at 15:09 UTC | |
by joyfedl (Acolyte) on Jun 24, 2025 at 15:14 UTC |