Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've got names in a list like the following:
Bob Builder Tinky Winky Bugs Bunny Mickey Mouse
and ive basically got put them on separate lines. I think split can do this, and will store it in an array which is what i want but i have no idea how to split every other word?. I was also wondering if anybody knows how to remove spaces from the end of words
so if i had "hello " it would give me "hello"...will s// /; do it?
Thank you all
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split every second word
by broquaint (Abbot) on Dec 04, 2003 at 15:32 UTC | |
|
Re: split every second word
by shockme (Chaplain) on Dec 04, 2003 at 15:56 UTC | |
|
Re: split every second word
by Art_XIV (Hermit) on Dec 04, 2003 at 16:24 UTC | |
by grinder (Bishop) on Dec 04, 2003 at 17:05 UTC | |
by Art_XIV (Hermit) on Dec 04, 2003 at 18:11 UTC | |
|
Re: split every second word
by Anonymous Monk on Dec 04, 2003 at 23:57 UTC | |
|
Re: split every second word
by duff (Parson) on Dec 05, 2003 at 00:21 UTC | |
|
Re: split every second word
by jweed (Chaplain) on Dec 04, 2003 at 15:43 UTC |