This dog won't hunt.

   Global symbol "$k" requires explicit package name at sesemin.pl line 72.
   syntax error at sesemin.pl line 72, near "})"
where, by the time I sorted out the files and such, line 72 is:&count_unique (@{$genes_number{$k});

Even fixing the trivial syntax error, one's left with the undefined $k at this point. I could guess at what $k is supposed to be here... but I think it's time for you to do some work !

Happy to try to help, but you need to put more effort in at your end, so that the code you offer:

  1. actually runs -- with strict and warnings.
  2. does not require other files to be downloaded -- let alone placed in special directories. (see below)
  3. does not require command line arguments -- whatever you need to demonstrate should be inside the code.
  4. illustrates the issue you have, with the minimum of code.
  5. supports the question you've posed... "I am trying to achieve blah to which end I have written blather which is supposed to mangle stuff so, but what I get is a crick in my neck...., as demonstrated in the very wonderful code here...
  6. and all the other good advice in How do I post a question effectively?


If your code only has one input file, then __DATA__ is the obvious replacement.

If your code has several inputs, then this will do the trick. First, comment out (or remove) the original open commands and replace as illustrated:

#open FOO, "my_favourite.yum" or die "horribly $!" ; open FOO, '<', &my_favourite_yum or die "horribly $!" ;
then at the end of your example code place:
#______________________________________ # ... description of the data ... sub my_favourite_yum { \(<<'~~FILE') } ... contents of my_favourite.yum go here ... ~~FILE #______________________________________ # ... description.... sub my_other_favourite { \(<<'~~FILE') } ... contents of my_other_favourite go here ... ~~FILE #______________________________________
where:
  1. obviously, the name of the sub must match the name in the relevant open, but may be anything you like that helps the reader.
  2. the end of file marker '~~FILE' can be anything you like, but obviously it must not appear in the data ! (For the avoidance of doubt, it may be different for each file, but must be the same in the two places it appears for each one.)
  3. the marker at the end of each "file" must have a newline at the end of it. (No other trailing whitespace. End-of-file will not do -- hence the suggested #____ line at the end.
  4. NB: tabs may be translated to one or more spaces in the upload process. But ...
  5. before posting, you must ensure that your example code works (and illustrates the issue you have) with the files embedded.

Update: removed spurious and erroneous & from sub &my_favourite_yum and sub &my_other_favourite. Thanks tinita. (Blushes deep crimson and wonders whether going back to bed and starting again is an option.)


In reply to Re^3: Print Uniqe elements of arry of hash by gone2015
in thread Print Uniqe elements of arry of hash by sesemin

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.