On Fri, 27 Sep 2013, Mark D. Nagel wrote: > On 9/27/2013 2:06 PM, Risto Vaarandi wrote: >> >> >> As I understand, you'd like to have a separate action which could take >> varmap names as >> parameters, and would pass references to given varmaps into a Perl function? >> kind regards, > > Right -- would want to be able to access the hash in an lcall, for example. > Then I could > (in this case) do something like (for example, though I can't envision the > right syntax at > the moment): > > lcall %o $*(WINDOWS} ( sub { my $varmap = shift; for my $key (%$varmap) { > ($ENV{"SEC_WINDOWS_$key"} = $varmap->{$key} } } ) > > In this case, we could then have Template Toolkit sections that look like: > > [% IF sec.windows.eventid == 2001 AND sec.windows.eventsource == 'Whatever' %] > foo bar baz bot > [% END %] > > This would be really powerful stuff in this case. > > So this would be a great add, unless you have some other ideas on how to > enumerate the > hash with existing facilities.
remember that Perl variables (including hashes) that you create with one rule can be accessed by your perl code in any other rule. you don't _have_ to use varmap. If your flatten routine sets a variable %hash and then returns a reference to it, you can have other commands just access $hash{key} David Lang ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users