Hi all, I have a problem(!) but I can't understand why is it so. I have a set of variables (Which is all scalars) and an array to be passed on to a subroutine. The array and the scalars come from two different subroutines. Please see the code below

my ($id_snp, $id_assay, $session, $load_set) = @_; #these variables my (@lines) = @_; #this array my $plate_id = $cgi->param('plate'); my $barcode = Verifynumber($plate_id); my $plate = $barcode->{Number}; my $dna_well; $dna_well = $STATEMENTS->get("geno_manifest.sql_lib::get_dnawell", +[$plate, lc$lines[2]]); print "dna_well: $dna_well->[0]->[0]"; print "SNP: $id_snp, assay:$id_assay , session $session, load_set: + $load_set";
The result I get is:
SNP: 8925827, assay:67 , session 5884, load_set: 227dna_well: 5381721( + which is right. and the rest of the results are the values of the scalar are from the array @lines). SNP: True, assay:3200768 , session A1, load_set: EPS316120dna_well: 53 +81817SNP: True, assay:3200768 , session A2, load_set: EPS31807
Also, the dna_well which is processed in this subroutine hasn't got a problem. Could any one suggest me what I am doing wrong here. And why is that using the array values if used along with the variables. Thanks for you help in advance
The @lines is something like this:
True 3200768 A1 EPS316120 8.535 17.575 GG 0.90 True 3200768 A2 EPS318077 8.820 17.126 GG 0.95 True 255 A3 EPS316121 17.084 13.650 GA 0.97 True 3200768 A4 EPS318078 8.541 16.653 GG 0.94 True 16744448 A5 EPS316122 18.267 3.880 AA + 1.00 True 255 A6 EPS318079 13.130 11.004 GA 0.91
Thanks a lot.

In reply to passing an array and some scalars to a subroutne 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.