$/ = qq{"\$"\t""\t""\n};

You've got too much here. It should probably be qq{\$\t\t\n}, or something similar. You've got qq{}, which is double quotes so interpolates, but then "" wrapping the pieces inside. The interior quotes are left in. Try printing $/ to see what you've got. Presumably you are not getting the DEBUG messages, which means its likely just trying to grab the whole file. Your previous post, also, doesn't mention the tabs in the record separator.

You should take, as your sample file, the first three of entries from your main file. If it works on that it should work on the rest (or die with an error).

Finally, build your script slowly. Comment out everything in the while loop. Add print $_;. If thats right, add the my $file ... line in. Print and check. Repeat. (Poor mans testing!).

qq


In reply to Re: Optimizing a script by qq
in thread Optimizing a script by Micz

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.