On Jul 6, 2004, at 4:09 PM, Wil wrote:

Dear Folks,

I'm trying to split a line that contains a pipe "|" and I cann't find a way
how to do it. If i put a back slash "\", it doesn't work either. Can
somebody help me how to do it?

There's really nothing wrong with your code, so the problem is something you aren't showing us.


split() takes a regex to split on, so the pipe does need to be escaped.

split m/\|/, $line

Perhaps if you post the rest of the code we'll see other things, but first are you using "strict" and "warnings"? If not you should be. They might just lead you to the problem.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to