ASCII 0a vs 5c6e

M

Mike Hartsough

I'm a perl neophyte, and I'm running into some difficulty with some text I
need to parse.

I invoke a command that returns a large chunk of text. Included in this text
are newline ASCII characters (0a), and one instance of the text string "\n"
(5c6e).

I need to remove all text up to and including the first newline (0A) (which
includes the "\n"), but the code I've been writing appears to _sometimes_
treat the "\n" (5c6e) as a newline. But when I try to account for this in my
code, it doesn't seem to work.

Here's what I have right now:

$Blob =~ /(\n)(\n)(.*)/s;

I'm using the 's' qualifier because I want it to ignore all the subsequent
newlines.

With the two "(\n)" it skips too many newlines and strips out needed text.
If I remove one of the "(\n)", it treats the text "\n" (5c6e) as a newline,
so it doesn't strip out enough.

Help?

Thanks,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,290
Messages
2,571,453
Members
48,129
Latest member
DianneCarn

Latest Threads

Top