Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
the program loops endlessly. What am I doing wrong? Thanks in advance$query = "bush and clinton and bush and obama and huckabee"; @searchTexts = split (/and|or/i,$query); for ($i = 0; $i <= @searchTexts +1 -1; $i++) { @searchTexts[$i] =~ s/^\s+//; @searchTexts[$i] =~ s/\s+$//; print @searchTexts[$i]."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Huge simple problem
by dreadpiratepeter (Priest) on Aug 05, 2009 at 22:43 UTC | |
by dsheroh (Monsignor) on Aug 06, 2009 at 00:04 UTC | |
by Anonymous Monk on Aug 06, 2009 at 01:00 UTC | |
by Anonymous Monk on Aug 06, 2009 at 01:01 UTC | |
by dreadpiratepeter (Priest) on Aug 06, 2009 at 04:07 UTC | |
by Anonymous Monk on Aug 05, 2009 at 23:07 UTC | |
|
Re: Huge simple problem
by leighsharpe (Monk) on Aug 06, 2009 at 03:37 UTC | |
|
Re: Huge simple problem
by Anonymous Monk on Aug 05, 2009 at 22:23 UTC | |
by toolic (Bishop) on Aug 06, 2009 at 01:07 UTC | |
by almut (Canon) on Aug 06, 2009 at 02:05 UTC | |
by toolic (Bishop) on Aug 06, 2009 at 17:33 UTC |