Hello all,
Thank to all. I found out that there is a perl module member.pm available which should perform the same function as Skill language member().
Again I am stuck in the loop. I want to print the pair of integer values for only the member of @arr e.g. in this case the pair integer values for Stack3 and Stack5 should be printed. Somehow the member function is reading only the first element of my array.Somebody advice where I am doing wrong?

Here is my code;
#!/usr/bin/perl -w sub member { my $target = shift or die "No target in member/2 "; for (0..$#_) { return $_ if $_[$_] eq $target; } return undef ; } @arr = qw/DRAM1.new_quad_stack.3 DRAM1.new_quad_stack.5 /; open (IN , "$file"); while () { next unless /@arr[member($_,@arr)]/ ; while () { last if /End/ ; print $_ ; } } close IN ;
And here is the file;
*******Voltage********* *[PRD=S][BLD=4.0.0][OS=2000][CN=MUCW6086][USR= +Djordjev][PYM=1023.004MB][PKM=] *[DC=Y][PSE=Y][TLML=N][NRTB=Y][IPC=N][PC=N][DLD=N][TS=232303] *[FN=CA_2T_400_8ranks.cur][DT=Wed_Jul_14_02:15:17_2004][LC=red][LS=RL] +[LP=NN][LW=1][LM=NN][LMS=1][LMI=1] **************Curve*************** DRAM1.new_quad_stack.3 DRAM1.new_quad_stack.1::GND red V1. 0.000000e+000 1.508947e+0003 1.162272e-012 1.508947e+0003 2.324544e-012 1.508947e+0003 3.486816e-012 1.508947e+0003 4.649088e-012 1.508947e+0003 5.811360e-012 1.508946e+0003 **************End*************** *[PRD=S][BLD=4.0.0][OS=2000][CN=MUCW6086][USR=Djordjev][PYM=1023.004MB +][PKM=] *[DC=Y][PSE=Y][TLML=N][NRTB=Y][IPC=N][PC=N][DLD=N][TS=232303] *[FN=CA_2T_400_8ranks.cur][DT=Wed_Jul_14_02:15:17_2004][LC=cyan][LS=RL +][LP=NN][LW=1][LM=NN][LMS=1][LMI=1] **************Curve*************** DRAM1.new_quad_stack.4DRAM1.new_quad_stack.1::GND cyan V2. 0.000000e+000 1.508947e+0004 1.162272e-012 1.508947e+0004 2.324544e-012 1.508947e+0004 3.486816e-012 1.508947e+0004 4.649088e-012 1.508947e+0004 5.811360e-012 1.508947e+0004 **************End*************** *[PRD=S][BLD=4.0.0][OS=2000][CN=MUCW6086][USR=Djordjev][PYM=1023.004MB +][PKM=] *[DC=Y][PSE=Y][TLML=N][NRTB=Y][IPC=N][PC=N][DLD=N][TS=232303] *[FN=CA_2T_400_8ranks.cur][DT=Wed_Jul_14_02:15:18_2004][LC=red][LS=RL] +[LP=NN][LW=1][LM=NN][LMS=1][LMI=1] **************Curve*************** DRAM1.new_quad_stack.5DRAM1.new_qua +d_stack.1::GND red V3. 0.000000e+000 1.508947e+0005 1.162272e-012 1.508947e+0005 2.324544e-012 1.508947e+0005 3.486816e-012 1.508947e+0005 4.649088e-012 1.508947e+0005 5.811360e-012 1.508947e+0005 **************End***************

20050627 Edit by ysth: code tags


In reply to Re^3: Looking for function similer to member() in SKILL by Anonymous Monk
in thread Looking for function similer to member() in SKILL by riz

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.