Yes, of course I meant \r. I spend the day going back and forth from windows
and *nix.......
In any event
$a="M";
$b=ord($a);
print $b;

runs nifty fine and prints a 77 as an uppercase M should be.

running
$a="\r";
$b=ord($a);
print "$b\n";
$a="\x0D";
$b=ord($a);
print "$b\n";
$a="\015";
$b=ord($a);
print "$b\n";

prints
    10
    13
    13

 So, ok. I now know how to get a CR in MacPerl. However, why does MacPerl
convert \r to \n ?




Ronald J Kimball wrote:

> On Mon, Jun 11, 2001 at 09:26:49PM -0400, Adam Russell wrote:
> > in cases when presented with a  script( devloped on *nix)  that contains
> > a /r (ASCII 13) would it help to simply replace the /r with a /13 so as
> > to avoid the automatic conversion to a linefeed?
>
> You mean \r...  What is the context of the carriage return character?  If
> it's inside a double-quotish string, try changing the carriage return to
> the two characters \ and r: Perl will interpolate those two characters to a
> carriage return.  \015 and \x0D will work too.
>
> Ronald

Reply via email to