in reply to Help with the push function
Usually, a <ul>...</ul> element contains multiple <li>...</li> elements, but your initial regex assumes there is never more than one "li" within a given "ul". But if you're sure that "answers" are always marked up that way, then that should be fine.
After each regex, you are pushing the whole (remaining) content of $line onto your answers array, but I think you really want to push @answers, $1;
Apart from that, it might help to provide some sample input, and a sample of what you would want as a result (intended contents of @answers and @questions).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with the push function
by mistamutt (Novice) on Feb 16, 2011 at 06:58 UTC | |
by graff (Chancellor) on Feb 18, 2011 at 05:10 UTC |