Hello,
I am writing a program in perl that will periodically write values to a GA_StringDIctionary object in the repo. This is my first script to use the Perl API, so I apologize for my ignorance. The issue that I having is that I cannot figure out how to insert values for key pairs. I've tried a couple of things, but haven't come accross anything to do this.
my $tunnelDict = $session->create( "GA_StringDictionary::SWIFT_ConnecticityMonitor-Tunnels" );
foreach my $dTunnel (keys(%tunnels))
{
$tunnelDict->insert("key", ["$dTunnel", "$tunnels{$dTunnel}->{NotifiedTime}"]);
}
This is the closest thing that looks like what I want to do is above but this doesn't work.
Has anyone tried writing key value pairs to a GA_StringDictionary using the Perl API that could give me some guidance.
Hi, I can not find the examples in perl_ref guide.
Why you not use ASL code? Where is your key value defined ? Key should be unique.
Try to use this code, or insertElement functions page 49 in perl_ref, sorry not tested by myself $tunnelDict->insert($dTunnel, $tunnels{$dTunnel}->{NotifiedTime});
what you show us in the code is : insert( "key", [ key, value ] );
you should use: insert( key, value );
--Fred
== Monitor your Smarts environment using APG ReportPack for Smarts health == Frederic Meunier Solutions Watch4Net Inc APG & Smarts InCharge integration http://www.watch4net.com
Hemulll
2 Intern
•
138 Posts
561
0
Posted June 19th, 2009 22:00
I can not find the examples in perl_ref guide.
Why you not use ASL code?
Where is your key value defined ? Key should be unique.
Try to use this code, or insertElement functions page 49 in perl_ref, sorry not tested by myself
$tunnelDict->insert($dTunnel, $tunnels{$dTunnel}->{NotifiedTime});
ASL code example
foreach processor (cpuTable) {
if (defined(cpuTable[processor])) {
procObj = nodeObj->makeProcessor(string(processor));
undef(historyTable[procObj->Name])?IGNORE;
relKey = nodeObj->Name."|".processor."|";
relObj->insert(relKey, string(procObj->Name));
}
}