The resulting data structure is an array reference. This may not be what you want, however. Check this out (assuming your data file):
Again, since i really do not know what your target is, i had to improvise. Now is the time when i wish i could be at your computer ... but alas ... if you want to continue this disussion, let's work via /msg and scratchpad's - no need to waste database space. ;)$_->dump_os for @agents; # yields: $VAR1 = [ 'SUN', 'Solaris 8' ]; $VAR1 = [ 'IBM', 'AIX 4.3.3' ]; # etc.
UPDATE:
After some discussion via /msg's, i feel that storing the
os's in a hash is not necessary at all. If you store them
in an array reference as i have done, you can test for a
particular OS by using grep. Here is an example:
Of course, you could also grep a hash, but that seems a bit like using a square on a round hole to me. ;) Good luck!foreach (@agents) { $_->dump_os if grep /AIX/, @{$_->{os}}; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) 3Re: When I try to create different objects i end up getting the same one over and over...
by jeffa
in thread When I try to create different objects i end up getting the same one over and over...
by krujos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |