How do I use split in Perl?

jay28lee
jay28lee used Ask the Experts™
on
($total,$count)=split('|','1269|166');
print "total: $total, count: $count";

the above code is giving me:

total: 1, count: 2

shouldn't it be:

total: 1269, count: 166

instead?  i couldn't find out what's wrong?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Split pattern is a regular expression abd "|" symbol is special. Escape it with backslash.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial