On 07/28/10 19:12, Chandan Kumar wrote:
using split ,I would like to split on space character. Dont want to use character classes. my $string="108 ambulance 100\nfireengine141jack";my @array = split /' '/,$string; foreach my $value (@array){ print "$value \n"; } Result : its splitting on new line character.instead of space character. Can some one clarify ?
It's clarified in http://perldoc.perl.org/functions/split.html my @array = split / /, $string;
for the same if the string is enclosed in single quotes ,splitting is not happening on the given string.
Can you clarify what you mean by that? -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
