<?xml version="1.0" encoding="windows-1252"?>
<node id="932109" title="Re^4: How to access a hash from another file" created="2011-10-18 06:48:45" updated="2011-10-18 06:48:45">
<type id="11">
note</type>
<author id="917684">
vagabonding electron</author>
<data>
<field name="doctext">
Thank you [tospo].&lt;br&gt;The problem is that not each number can be combined with each evaluation name. Therefore I do need a config file. In fact I happened to populate the hash %module reading the csv-file in the following way:
&lt;c&gt;
open(my $fh, "&lt;", "parameter.csv") or die "$!";
my $header = &lt;$fh&gt;;
while(&lt;$fh&gt;)	{
	my @line = split(/;/, $_);
	my $t = $line[0];
	${module}{$t}{name} = $line[1];
	my $n = $line[2];	
	${module}{$t}{indicator}{$n}{ind} = $line[3];
	${module}{$t}{indicator}{$n}{yscala} = $line[4];
}
close $fh;
&lt;/c&gt;
The file names in the gnuplot command are generated afterwards on the fly whereby only the names are created which are allowed by config file.
&lt;br&gt;After that I used the code from [wfsp] from [id://931151] in the following way:
&lt;c&gt;
my @cmds;
for my $number (sort keys %{${module}{$topic}{indicator}}){
  my $cmd = build_command($number, %args);
  push @cmds, $cmd;
}

for (my $i=0; $i&lt;@cmds; $i++) {
		if($i == 0 or $i % 2 == 0)	{
			$cmds[$i] = "$multiplot\n\n$cmds[$i]";
		}
}

for (my $i=0; $i&lt;@cmds; $i++) {
		if($i % 2 == 1 or $i == $#cmds)	{
			$cmds[$i] = "$cmds[$i]\n\n unset multiplot\n\n";
		}
}

my $slurpline;
for (my $i=0; $i&lt;@cmds; $i++) {
		$slurpline.=$cmds[$i];
}
&lt;/c&gt;
&lt;br&gt;

The gnuplot command itself is very short now:
&lt;c&gt;
open my $P, "|-", "gnuplot" or die;

printflush $P qq[
        		
		$postscript
		
		$slurpline
		
			
]; 

close $P;
&lt;/c&gt;
&lt;br&gt;Thanks again!&lt;br&gt;VE
</field>
<field name="root_node">
931485</field>
<field name="parent_node">
931556</field>
</data>
</node>
