in reply to Re: Re: Re: Why is it matching??
in thread Why is it matching??

How would one add in a newline into the print statement? The main problem I'm running into is that usage of quotations of any type throws the entire print statement off, causing it to print join rather that actaully join the sequences, etc. As well, is seems I would almost have to rewrite it to fit the newline in; when i do, it does at least come out on separate lines. The data is coming out now with original print statement, but all on one line now; I need it on separate lines...:-(...
#my rewritten statement, for better or worse for (keys %probes) { print "$target_name, ':' join', ', @{$probes{$_}}, \n"; } _output_ 244901, ':' join', ', TTGCTGCTATTCTATCTATTTGTGC GACTTTCAAAGTGACTCTCGA +CGGG GAGCCTCCAGGCTATTCAGGAAGAA GAAGAATCGCAGCAATTCCCCAATC GAAGTAGTTCCT +CCGGAATCCAATG TCAGCTTGCGAATTTGTGGCACCGT TTACCAATGGCACGCTGTGCGCCTA GCA +AGCTTTGTTATGCCGAAACCTA AACACTTACAAATGCCACTTCTTCC GTCGCATCCGTTTTCAGGAC +GATCT AGCAATTTGCCTACTCTTGTATCTC, 244902, ':' join', ', GTATTCGGGGAATCCTCCTTAATAG ATATTCCTATTATGTCAATGC +CAAT AGCTGTGAATTCGAACTTTTTGGTA GGTATTTTCCGTTTCTTCGGATGAT GATGGGTCAAGT +ATTTGCTTCATTG TGCTTCATTGGTTCCAACGGTGGCA CCAACGGTGGCAGCTGCGGAATCCG GCG +GAATCCGCTATTGGGTTAGCCA TAGCCATTTTCGTTATAACTTTCCG TAACTTTCCGAGTCCGAGGT +ACTAT GAGTCCGAGGTACTATTGCTGTAGA,
Bioinformatics

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Why is it matching??
by BrowserUk (Patriarch) on Sep 12, 2003 at 17:16 UTC

    Close. You need to note the differences between "s and 's a little more carefully:)

    I think this does what you want. Sometimes it helps to spread the individual clauses of a statement across seperate lines. It helps you keep track of what is going on. I've also added parens to the join function. They often aren't necessary, but it helps to clarify what bits are arguments to join and which bits (the return from join included) are arguments to print.

    for (keys %probes) { print "$target_name :\n", join( "\n", @{$probes{$_}} ), "\n"; }

    HTH.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.