I'm a relative newbie to PERL and I am trying to figure out how to handle this simple task.

I have a text file with a capture of commands associated with a software build.

e:\green\prelink.exe -X4 -c "e:\green\gnm.exe -c++" -Le:\green\ppc403 + \ obj\hello.o obj\shop.o obj\catalog.o obj\scan.o obj\strings.o +\ obj\itemlist.o -- -lscnoe e:\green\decode.exe < C:\DOCUME~1\BUILD~1.ELE\LOCALS~1\Temp\ghjs1.ler rm -f C:\DOCUME~1\BUILD~1.ELE\LOCALS~1\Temp\ghjs1.ler e:\green\gnm.exe -s catalog > C:\DOCUME~1\BUILD~1.ELE\LOCALS~1\Temp\gh +js2.nm e:\green\dblink.exe -dbopath=obj -nm=gnm \ C:\DOCUME~1\BUILD~1.ELE\LOCALS~1\Temp\ghjs2.nm -o catalog.dnm +\ e:\green\ppc403\crt0.dbo e:\green\ppc403\libmulti.dba \ e:\green\ppc403\libscnoe.dba e:\green\ppc403\libsedgnoe.dba \ e:\green\ppc403\libdbmem.dba e:\green\ppc403\libansi.dba \ e:\green\ppc403\libind.dba e:\green\ppc403\libsys.dba \ e:\green\ppc403\libarch.dba rm -f C:\DOCUME~1\BUILD~1.ELE\LOCALS~1\Temp\ghjs2.nm

These are all command lines for a build. I need to separate each command line (which extends over multiple lines with the " \" at the end until there is one without that), count them, and then put them into a makefile so they can be executed with gmake.

Any ideas how I should approach this?


In reply to Breaking up a text file to make a Makefile by flybd5

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.