E
ebm
is there an easier way to capture the values from a hash of an array?
here's what %data looks like if I use Dumper
---------------------------------------------------
%data using Dumper
$VAR1 = bless( {
'fnames' => [
'OwnerID',
'FaxDateTime',
'ElapsedTime',
'Pages'
],
'field' => {
'ElapsedTime' => 2,
'OwnerID' => 0,
'Pages' => 3,
'FaxDateTime' => 1
}
}
);
---------------------------------------------------------------
@keys = keys(%{$data->{'field'}});
@val = values (%{$data->{'field'}});
while(@keys){
$num = pop(@val);
$keyname = pop(@keys);
@k[$num]= $keyname;
}
This way the Key and the Value will be in the correct position of the
array. IE if Data->Field->ElapsedTime = array position 2.
Please let me know.
Thanks in advance.
here's what %data looks like if I use Dumper
---------------------------------------------------
%data using Dumper
$VAR1 = bless( {
'fnames' => [
'OwnerID',
'FaxDateTime',
'ElapsedTime',
'Pages'
],
'field' => {
'ElapsedTime' => 2,
'OwnerID' => 0,
'Pages' => 3,
'FaxDateTime' => 1
}
}
);
---------------------------------------------------------------
@keys = keys(%{$data->{'field'}});
@val = values (%{$data->{'field'}});
while(@keys){
$num = pop(@val);
$keyname = pop(@keys);
@k[$num]= $keyname;
}
This way the Key and the Value will be in the correct position of the
array. IE if Data->Field->ElapsedTime = array position 2.
Please let me know.
Thanks in advance.