in reply to Re: Need doubled quoted values
in thread Need doubled quoted values

My question is, how do I double quote the individual values in datac.txt?

Replies are listed 'Best First'.
Re^3: Need doubled quoted values
by LanX (Saint) on Mar 02, 2015 at 02:11 UTC
    Use map{"\"$_\""} before you use join

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)

    PS: Je suis Charlie!

    Update
    Added escaped double quotes

    update
    Fixed lost underscore

      Shouldn't that be  map { "\"$_\"" } (added missing underscore), or perhaps better  map { qq{"$_"} } or even just  map qq{"$_"}, (note: comma is needed)?

      c:\@Work\Perl>perl -wMstrict -le "my $s = join '^', map qq{\"$_\"}, 'foo bar', 'baz boff'; print qq{:$s:}; " :"foo bar"^"baz boff":


      Give a man a fish:  <%-(-(-(-<

        Yes fixing one bug caused another typo.

        Maybe I should stop posting from mobile? :)

        Hmm...

        Well I just decided that I will stop posting code from mobile! :)

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)

        PS: Je suis Charlie!