in reply to Using the Variable Name from an Array
It's not 100% clear to me what you want to do or expect to happen here, but perhaps an AoH would be better suited than a plain array?
#!/usr/bin/env perl use strict; use warnings; my $id = 'foo'; my $Record_Lock = 'bar'; my $Record_Change_Date = 'baz'; my @elements = ( {name => 'id', value => $id }, {name => 'Record_Lock', value => $Record_Lock }, {name => 'Record_Change_Date', value => $Record_Change_Date} ); for my $elem (@elements) { print "Elem name $elem->{name} has value $elem->{value}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using the Variable Name from an Array
by perlgates (Initiate) on Nov 14, 2019 at 16:58 UTC | |
by shmem (Chancellor) on Nov 14, 2019 at 17:13 UTC | |
by choroba (Cardinal) on Nov 14, 2019 at 17:11 UTC |