Dear All,
thank you very much for your help! You guys are great.
I used the solution from wfsp with some modification since $number should be able to be changed. Therefore I took the parts of the solutions of tospo and aartist too. However I gave up the loops with $number because I had to print the title for each plot too. It is readable (imho) in the form of:  my $first = build_command('01', %args);.
I put the complete script here including the gnuplot part.
I knew about the module Chart::Gnuplot. Unfortunately I still cannot download modules on my pc at work. Yes I read Yes, even you can use CPAN - none of the solutions works here. The only one were to copy and paste the code but the module has the XS part so it does not work either. I was not able to persuade my manager as proposed in the article. The command structure in the job can be sometimes more tricky as HoH :-)
Thanks again!
VE
use warnings; use strict; my $output = "C:/ .../output.ps"; my $multiplot_title = = qq{set multiplot layout 2, 1 title "The Evalua +tion X" font "Helvetica-Bold,16" set key inside right bottom set xlabel "{/Helvetica=12 Years}" norotate set ylabel "{/Helvetica=12 Results}" rotate by -270 } ; my %args = ( years => q{[2005.5:2011.5]}, yscala => q{[:100]}, sources => [ { source => q{abc}, color => q{#000080}, title => q{"{/Helvetica=10 ABC_Stuff}"}, }, { source => q{def}, color => q{#800080}, title => q{"{/Helvetica=10 DEF_Stuff}"}, }, { source => q{ghi}, color => q{#008000}, title => q{"{/Helvetica=10 GHI_Stuff}"}, }, { source => q{jkl}, color => q{#000000}, title => q{"{/Helvetica=10 JKL_Stuff}"}, }, ], topic => q{this}, abnormality_border => q{mno}, ); my $first = build_command('01', %args); my $second = build_command('02', %args); my $third = build_command('03', %args); my $fourth = build_command('04', %args); my $fifth = build_command('05', %args); my $sixth = build_command('06', %args); sub build_command { my $num = shift; my %args = @_; my $cmd = sprintf( qq{plot %s %s }, $args{years}, $args{yscala} ); for my $source (@{$args{sources}}){ $cmd .= sprintf( qq{"C:/Stuff/%s_%s_%s.csv" title "" with errorbars lt rgb "%s" l +w 2, }, $source->{source}, $args{topic}, $num, $source->{color}, ); $cmd .= sprintf( qq{"C:/Stuff/%s_%s_%s.csv" title %s with lines lt rgb "%s" lw 3, + }, $source->{source}, $args{topic}, $num, $source->{title}, $source->{color}, ); } $cmd .= sprintf( qq{"C:/Stuff/%s_%s_%s.csv" with steps lt 1 lw 5 title "{/Helvetica +=10 Abnormality Border}" \n\n\n}, $args{abnormality_border}, $args{topic}, $num, ); return $cmd; } open my $P, "|-", "C:/.../gnuplot" or die; printflush $P qq[ set terminal postscript color portrait set output "$output" set termoption enhanced set encoding iso_8859_1 ###################################### $multiplot_title set title "The First Indicator" $first set title "The Second Indicator" $second unset multiplot ###################################### $multiplot_title set title "The Third Indicator" $third set title "The Fourth Indicator" $fourth unset multiplot ###################################### $multiplot_title set title "The Fifth Indicator" $fifth set title "The Sixth Indicator" $sixth unset multiplot ###################################### ]; close $P;

In reply to Re: How to declare variables per loop by vagabonding electron
in thread How to declare variables per loop by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.