in reply to No xml module please
But if you are allergic to modules and your string always has the fixed format shown above, you can use quick and dirty shortcuts that will bite you when the format cahnges :)
A hack such as this will do the trick:
-Markmy $string = "<message><file>D:\linkctltr.cxx</file><line>68</line><ty +pe>Note</type><codee>970</codee><desc>Use outside of a typedef</desc> +</message>"; $string =~ /<file>([^<]+)/; my $file = $1; $string =~ /<line>([^<]+)/; my $line = $1; $string =~ /<type>([^<]+)/; my $type = $1; $string =~ /<codee>([^<]+)/; my $codee = $1; $string =~ /<desc>([^<]+)/; my $desc = $1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: No xml module please
by Ovid (Cardinal) on Jul 18, 2002 at 16:04 UTC | |
by kvale (Monsignor) on Jul 18, 2002 at 19:25 UTC |