in reply to understanding print

Does $words[13] contain chr 13 (carriage return)?

Update:

use Data::Dumper; $Data::Dumper::Useqq = 1; print Dumper $words[13];
I think you'll see "\r" in there somewhere.

Update^2: s/say/print/;

Replies are listed 'Best First'.
Re^2: understanding print
by pdeshpan (Acolyte) on Aug 12, 2008 at 14:48 UTC
    Hello FunkyMonk! Thanks for replying. Incidently my code  wrds[13] is what had contained the information that I needed. The code was working with information from  wrds[13]. Unfortunately I could not try Data::Dump but the coincidence of you suspecting something about  wrds[13] and it containing my info. is strange. I used a work around (of manually putting the string in my variable which is not what I had written the code for) and went ahead with my work. But I shall be thankful if order change is understood. Regards.

      What FunkyMonk was getting to is that printing a carriage return ("\r") causes the cursor to move to the first column on many terminals. We suspect the value of $wrds[13] contains that character.

      >perl -le"print qq{abcdef\rghi}" ghidef

      Unfortunately I could not try Data::Dump

      Why not?