• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Perl Parse a file with | as dilimeter

I am having the hardest time parsting a plain file that is useing | as the delimeter.  I would really like to change the delimetere from | to ^ but i do not have that option.

@item = split(/|/, $line);

is not working :-/

what am i doing wrong?
0
dexter_modem
Asked:
dexter_modem
1 Solution
 
ericl1stCommented:
The character | is a special character and must be escpaed in regular expressions. Change your line to this and it should work:

@item = split(/\|/, $line);

Cheers!
0
 
dexter_modemAuthor Commented:
Thank you so much.. that was holding me up for a good 20 mins...
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now