[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] What am I missing?



This is a newbe type problem but I've got to ask. I'm trying to make a little
line format changer that goes from PC to Mac and back. It was easy, so I
thought. Today I discover that my "%" characters are disappearing from my text.
Here is the code I'm using:

  if ($text =~ /\r/) {
    $text =~ s/\r//g || die("Ahhh! Couldn't convert to MAC.\n");
  } else {
    $text =~ s/\n/\n\r/g || die("Ahhh! Couldn't convert to DOS.\n");
  }

It seemed easy enough to do. If it finds returns, strip them off. If it doesn't
find them, put them on. Why does the above code also remove percent signs
characters as well from my text?

Dennis Drescher