Don't ask to ask, just ask | |
PerlMonks |
splitting a stringby Anonymous Monk |
on Dec 04, 2008 at 06:48 UTC ( [id://727880]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, I am not able to split a string correctly. The string is as follows: my $string = "/home/source::::::::DATE:SUBJECT:NAME::::::"; If i use a the following code i am but able to split it correctly. my @array = split(":",$string); There are only 11 elements in the array. But there are 16 semicolons in that string. So there should be 16 elements in that array. When i print the array i am not getting the empty spaces after the value "NAME" in the string. Can any one help me on this???
Back to
Seekers of Perl Wisdom
|
|