The HTML document I'm trying to write this for is rather simple. It's a ordered list of quiz questions, followed by answers like this:
<ol> <li> Question? Answer. <li> Question? Answer. <li> Statement. Response to statement. <li> Question? <pre>Answer</pre> </ol>
What I'm trying to do is, get all of the questions into an array, and then put the quiz into a hash of questions and corresponding answers. So far I've removed the code, and span tags, removed the whitespace, and the extra newline characters. The questions always follow an <li> tag, with the answers coming after a question mark most times, but sometimes they follow <pre> tags and end at the closing pre tag, and some "questions" aren't questions at all and are statements that you respond to.
I tried to push @questions, $1 but it still isn't printing anything when I
foreach(@questions) { print "$_\n";
In reply to Re^2: Help with the push function
by mistamutt
in thread Help with the push function
by mistamutt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |