I would like to count how many events are in the file and store the information about each event into a two dimensional array (or something like that). Here are my thoughts. This regex<EVENT> <NAME>test2</NAME> <LOCATION>iwu</LOCATION> <TIME>now</TIME> <DATE>today</DATE> <PRIORITY>interest</PRIORITY> <ATTENDEES>a lot</ATTENDEES> <DESCRIPTION> descrip</DESCRIPTION> </EVENT> <EVENT> <NAME>test3</NAME> <LOCATION>hi</LOCATION> <TIME>joe</TIME> <DATE>how</DATE> <PRIORITY>interest</PRIORITY> <ATTENDEES>are</ATTENDEES> <DESCRIPTION> </DESCRIPTION> </EVENT>
,from what I understand, will place the place the text between the EVENT tags into a variable. However, I'm not sure what will happen if I have more than one set of EVENT tags such as in the XML above. I would like to isolate each event (and I want to have an indefinite number of events) into a separate array element. Then I can begin splitting up the data for each event into variables somehow. Does anyone have any ideas on how to do this. I would be very grateful for any help that you could offer me. Thanks for taking the time to read this. Joe Added: Forgive me, the above regex should look something more like this$variable =~ s/<EVENT>.*?<\/EVENT>//gi;
</more>if ($page_body =~ /.*?<EVENT>(.*?)<\/EVENT>.*?/) { $variable = $1; }
In reply to XML Parsing by JoeJaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |