tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE: Thanks months. /me whaps self on head...use strict; use warnings; #why does a split on a zero-length lookahead split the string... print "lookahead:\n"; my $string = 'abcde'; for ( split ( /(?=.)/, $string ) ) { print "$_\n"; } #but a split on just . does nothing? print "just .:\n"; for ( split ( /./, $string ) ) { print "$_\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why does split on /./ not split the string?
by GrandFather (Saint) on Dec 07, 2005 at 09:46 UTC | |
by ChemBoy (Priest) on Dec 07, 2005 at 18:55 UTC | |
Re: Why does split on /./ not split the string?
by TedPride (Priest) on Dec 07, 2005 at 09:46 UTC | |
Re: Why does split on /./ not split the string?
by radiantmatrix (Parson) on Dec 07, 2005 at 15:37 UTC | |
by QM (Parson) on Dec 07, 2005 at 19:59 UTC | |
by parv (Parson) on Dec 08, 2005 at 01:02 UTC | |
by QM (Parson) on Dec 08, 2005 at 04:39 UTC |