perlquestion
toro
<p>Bonjour, moines.</p>
<p>I want to assign strings with arbitrary characters to a variable.</p>
<p>First I tried double quotes:
<c>my $tweet = "RT @peteyorn: @Starbucks Thanks for putting the Break Up album for sale in your stores. \\ It's a great album! Nice work!"</c></p>
<p>That interpolates <c>@peteyorn</c> as an array.</p>
<p>I wisened up and tried single quotes. But the assignment doesn't terminate; Perl runs through the ending <c>'</c> on later lines. Next I tried <c>q{ TEXT }</c>:</p>
<p><c>my $tweet = q{RT @peteyorn: @Starbucks Thanks for putting the Break Up album for sale in your stores. \\ It's a great album! Nice work!}</c></p>
<p>That prints <c>\\</c> as <c>\</c>.</p>
<p>Is there a way to really, truly, literally, verbatim assign what's enclosed, no questions asked and no thoughts thunk on perl's part?</p>
<p>Salutations distinguées.<br/>
taureau</p>
<p><b>de plus:</b> <c>my $tweet</c> is just a particularly pesky example so I am coding against it. In the final application I will be piping a <c>.csv</c> through <c>@ARGV</c>, so will this problem just go away? (Some of the proposed solutions make me think so.)</p>