in reply to
split problem
You need to escape the | because it is a special character in regexes (
split
uses regexes):
my @array = split /\|/ ;
[download]
Comment on
Re: split problem
Download
Code
Replies are listed 'Best First'.
Re^2: split problem
by
crusty_collins
(Friar)
on Oct 02, 2014 at 18:09 UTC
I thought i tried that but i guess i didnt because that works! Thank you !
[reply]
Re^3: split problem
by
misterperl
(Friar)
on Oct 02, 2014 at 18:33 UTC
for safety I often use split /\s*\|\s*/ which will also remove whitespace between the quotes in case it's there.
[reply]
In Section
Seekers of Perl Wisdom