note
Schemer
<p>I guess the problem you are looking into solving revolves around your regexp not extracting your data as you would like.</p>
<p>Maybe you should consider putting your data is a less half-assed format (yours looks like XML, but it's not even XML, so it's even worse).</p>
<p>Use a simpler file format, don't reinvent XML badly. If you really need XML, use a module that will help you work with _real_ XML.</p>
<p>Here is an example of what you could have used:<p>
<code>
Instead of:
<?--1-News1-->
<b>This is option News 1 of 1</b>
</?--1-News1-->
<?--3-Third1of3-->
<b>Option Third 1 of 3</b>
</?--3-Third1of3-->
what about:
1,News,1,1
3,Third,1,3
Then you can do something like:
($num, $name, $index, $total) = split /,/, $data;
</code>
<p>Use simple data representation for simple stuff, if it get more complex look into using a database. Don't overwhelm yourself with <,>,--,/ and friends. Aim for simplicity, your problems will resolve themselves.</p><p> And finally, if you don't know what a particular piece of code in your program does (because, say, you've done some ctrl-c and some ctrl-v), remove it for now. Later, if you have a problem and you need to put it back in, you'll understand what it does.</p>
206907
206907