in reply to Is there any XML reader like this?
See also:use warnings; use strict; use XML::Simple; my $str = ' <servers> <station18> <ip>10.0.0.101</ip> <ip>10.0.1.101</ip> <ip>10.0.0.102</ip> <ip>10.0.0.103</ip> <ip>10.0.1.103</ip> </station18> <station19> <ip>10.0.0.111</ip> <ip>10.0.1.111</ip> <ip>10.0.0.112</ip> <ip>10.0.0.113</ip> <ip>10.0.1.113</ip> </station19> <station17> <ip>10.0.0.121</ip> <ip>10.0.1.121</ip> <ip>10.0.0.122</ip> <ip>10.0.0.123</ip> <ip>10.0.1.123</ip> </station17> </servers> '; my $xml = XMLin($str); print "$_\n" for @{ $xml->{station17}{ip} }; __END__ 10.0.0.121 10.0.1.121 10.0.0.122 10.0.0.123 10.0.1.123
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there any XML reader like this?
by ashok.g (Beadle) on Jan 15, 2012 at 14:43 UTC | |
by toolic (Bishop) on Jan 15, 2012 at 23:31 UTC |