From: C.DeRykus on 13 Jul 2010 01:48 On Jul 10, 4:48 pm, Peng Yu <pengyu...(a)gmail.com> wrote: > Suppose I have a string $x='\t\n', I want to convert it to $y="\t\n". > I also want to convert $y back to $x. I have googled. But I haven''t > any related function, maybe because I didn't use the right search > keywords. Would you please let me know what functions I can use to do > the conversions? eval qq{\$y = "$x"; 1} or die $@; But, I wouldn't necessarily recommend this. String eval is slow and needs safeguards if there's user input. See perldoc -f eval and perldoc perlsec -- Charles DeRykus
First
|
Prev
|
Pages: 1 2 Prev: FAQ 8.45 How do I install a module from CPAN? Next: Perl script permission question |