lonewolf28 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I've been trying out challenges in codeeval and in one of the challenges when i tried to split a string using "|" delimiter the split function wasn't working as it should.
my $string = 'osSE5Gu0Vi8WRq93UvkYZCjaOKeNJfTyH6tzDQbxFm4M1ndXIPh27wBA + rLclpg| 3 35 27 62 51 27 46 57 26 10 46 63 57 45 15 43 53'; my ( $first, $second ) = split ( "|", $string ); say "first:", $first; say "second:", $second; Output: first:o second:s
what mistake am i making ? I'd expect the first variable to hold the random characters and second to hold the numbers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split function not working as expected
by kcott (Archbishop) on Jul 28, 2015 at 03:39 UTC | |
|
Re^2: split function not working as expected
by derby (Abbot) on Jul 28, 2015 at 01:18 UTC | |
by AnomalousMonk (Archbishop) on Jul 28, 2015 at 03:22 UTC | |
by lonewolf28 (Beadle) on Jul 28, 2015 at 04:10 UTC | |
by AnomalousMonk (Archbishop) on Jul 28, 2015 at 05:08 UTC | |
by derby (Abbot) on Jul 28, 2015 at 11:43 UTC | |
|
Re^2: split function not working as expected
by Sathishkumar (Scribe) on Jul 28, 2015 at 08:02 UTC |