in reply to Re^2: Show error "Out of Mermory"!!
in thread Show error "Out of Mermory"!!

You've told XML::Simple to "ForceArray" (i.e. to always create arrays, even if there is only one element).  Thing is that ForceArray expects a boolean value, so as you have ForceArray => 'srw_dc:dc', you've enabled the feature globally (not only for 'srw_dc:dc' as the idea might have been...)

That means you have to access the resulting data structure accordingly, i.e. explicitly specify all array indices

my $records_data = $ref->{'records'}->[0]->{'record'}->... # or shorter my $records_data = $ref->{'records'}[0]{'record'}...

(note the [0] in between the fields 'records' and 'record')

Update: the thing with the "Pseudo-hashes are deprecated" is as follows: in short, as pseudo-hash is an array with a hash in its first element (index 0) that is being used to lookup the array indices to be used for the individual pseudo-hash fields (this applies to Perl versions < 5.10 only, btw).  E.g.

$pseudohash = [ { key => 5 } ];

When you, for example, write

$pseudohash->{key} = 42;

the resulting data structure would look like

$VAR1 = [ { 'key' => 5 }, undef, undef, undef, undef, 42 ];

Two things to note: (1) the pseudo-hash field 'key' maps to array index 5, and (2) the array is automatically resized (as usual, with all indices less than 5 being created as undef).

Now, XML::Simple (with ForceArray enabled) produces a data structure something like this

my $data = { 'records' => [ { 'record' => [ { 'recordPosition' => [ '1' ], }, ], }, ], };

so when you write

my $records_data = $ref->{'records'}->{'record'}->{'recordData'}

the hash that holds 'record' is being used as pseudo-hash indexing array (as it is at index 0 of the 'records' => [...] array/pseudo-hash). And due to what I would call a bug in Perl, using the arrayref as the pseudo-hash-mapped index, doesn't produce an error message, but rather is interpreted as a (typically huge) number, which in turn leads to Perl auto-resizing the array (in this case because of autovivification) until it runs out of memory in your case...