I am trying to write a perl-wrapper of sorts to an existing pipeline The pipeline uses a few long awk commands that I just want to be printed into a file (trying to automatically generate the pipeline for new files) But I cant seem to get perl to see the awk script as just words - it freaks at the symbols and after spending a long tome trying to backslash everything that might be a problem I am still getting errors... Any idea how I can get perl to see this line as simple text?

EDIT: Comments about adding script are duely noted

This is the awk command in question:

  awk '{indel=0;for(i=5;i<=NF,i++) {if(i~/REF/){split(i,a,";");split(a[1],b.":");} if(i~/[+-]) {split(a[1],c,":");indel+=c[2]}} print $1"_"$2+1,indel}' > parsed_data

I think that the " and ; symbols are giving perl grief... but I might be wrong

I have other awk cmd that I'd need to use and these are much longer (I don't want to backslash twenty symbols...

Thanks to everyone for their help!

Blur


In reply to awk cmd in perl by blur

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.