in reply to Manipulating data structure
Hi SerZKO!
Your hash-key does not need to be a static string, but could be constructed on the fly with a variable containing a counter. Check the following example
For your problem, you may either add a the number of available UIDs in your data-structure (and use it like the $max in the example above), or you might check with exists whether a specific UID-entry is present in your hash (e.g. if (exists($e{"MEX$nr"}) { ... }) HTH, Ratamy %e; my $max = 4; foreach my $nr (1..$max) { $e{"uid_$nr"} = $nr; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Manipulating data structure
by SerZKO (Beadle) on Aug 16, 2012 at 17:56 UTC |
In Section
Seekers of Perl Wisdom