Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I'd suggest writing a subroutine to read all your configurations into an array, and then when processing the input file you can simply load the current configuration. Something like:

my @configurations; load_configurations("config_file"); open my $FH, '<', $input_fname or die "Can't open $input_fname: $!"; while (<$FH>) { my @config_vars; ... parse out an input entry ... @config_vars = @$configurations[$configuration_ID]; ... code to process input using configuration variables... } sub load_configurations { my $fname = shift; open my $FH, '<', $fname or die "Can't open $fname: $!"; while (<$FH>) { my @config_vars; ... parse out a configuration... $configurations[$configuration_ID] = [ @config_vars ]; } }

This way, you have all the configurations at your fingertips, and you can process each input entry with a different configuration, if desired.


When your only tool is a hammer, all problems look like your thumb.

In reply to Re: Checking value of an extracted variable by roboticus
in thread Checking value of an extracted variable by r.biswas

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (2)
    As of 2018-05-24 04:25 GMT
    Find Nodes?
      Voting Booth?