Hi, I have file where i need to select the template block depending on what i specify in the command line. Below is my file
template1(test1,test2) { variable_1 : input; index_1(" 1.0, 2.0"); index_2(" 1.0, 2.0"); } templat2(test1,!test2) { variable_1 : output; index_1(" 1.0, 2.0"); } template3(!test1,test2) { variable_1 : time; index_2(" 1.0, 2.0"); } template4(!test1,!test2) { variable_1 : time; index_1(" 1.0, 2.0"); }
i.e,if i specify "test1" in the command line,i need to select template2 as template2 contains test1,!test2 (because i have not specified test2 in the command line.) to explain using a table
command line template selection reason test1 template2 test1 ,no test2 not specified test2 template3 test2 specified test1 not specfied test1,test2 template1 both are specified nothing in command line template4 both are not specified
currently i know how to get the values from command line . i am storing it in an array.but i dont know how to deal with the expression "test1,!test2" (this kind of expression) in the file. -Madam

In reply to regexp matching issue by Madam

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.