tlemons has asked for the wisdom of the Perl Monks concerning the following question:
I apologize in advance for the stupid question. I've used 'split' to process a long text string into an array. Some of the array elements now look empty, but I suspect that they contain a newline character.
I want to test for the presence of this array element containing only a newline. I've tried this:
but it matches on every array element, since every array element contains a text string. How can I test for any array element that ONLY contain a single newline character?until ($discovered[$i] =~ "\n")
Thanks tl
Edit by castaway - Added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Test for newline
by BUU (Prior) on Feb 19, 2005 at 08:16 UTC | |
|
Re: Test for newline
by gopalr (Priest) on Feb 19, 2005 at 06:58 UTC | |
by betterworld (Curate) on Feb 19, 2005 at 13:57 UTC | |
|
Re: Test for newline
by renz (Scribe) on Feb 19, 2005 at 06:53 UTC | |
|
Re: Test for newline
by saintmike (Vicar) on Feb 19, 2005 at 08:23 UTC | |
by BUU (Prior) on Feb 19, 2005 at 09:23 UTC | |
by saintmike (Vicar) on Feb 19, 2005 at 19:24 UTC | |
by holli (Abbot) on Feb 19, 2005 at 09:42 UTC |