#! perl -slw use strict; use Data::Dumper; my $trans = '<status>G</status><auth_code>TT1506</auth_code><security_ +result>M</security_result><order_number>0006-00310-38259</order_numbe +r> '; my %hash; $hash{$1} = $2 while $trans =~ m[<([^>]+)>(.*?)</\1>]g; print Dumper \%hash; __END__ C:\test>251350 $VAR1 = { 'status' => 'G', 'security_result' => 'M', 'order_number' => '0006-00310-38259', 'auth_code' => 'TT1506' };
In reply to Re: Text Parsing
by BrowserUk
in thread Text Parsing
by spaceout
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |