Based on what you've said so far about your goal:

Currently I am trying to get PERL to read all of the lines in the first file, split them, and print one column. I also am trying to do the same using globbing for the other 250+ files. When I do either of these in isolation I can do this perfectly and generate exactly the results I need. However, when I combine the code...

I don't know what sort of output you really want to get when you "combine the code". I gather it has something to do with combining the two sets of data, and "complex searching", but... how would you describe/define that, exactly?

Writing a reduced output version of every input file is an okay thing to do, I guess, but how does it help in moving you toward to your real goal (whatever that is)? If you could reach that goal without writing all those output files, wouldn't that be better?

Apart from the very good advice given in the earlier replies, I would encourage you to pay attention to the visual appearance of your code: things like proper indentation and strategic use of an occasional blank line (to delimit logical chunks like loops and conditional blocks) can do wonders for making the code easier to manage and maintain. It does make a difference.

Also, this part of your code looks wrong -- maybe it works for you now, but I would not trust it:

($stamp,$extra,$orth,$a,...$z) = split(/ <|>;|\t/, $line1); #splitting all of the information after the first ";" into 2 scalars; $split = "$a ... $z"; ($canon,$spoke) = split(/; /, $split);
Please look again at the docs for split. You can split to an array (much easier and less brittle that a long list of scalars), and/or you can limit the number of elements returned by split. Examples:
# split into two scalars and an array: ( $field1, $field2, @rest ) = split( /$separators/, $input_string ); # or split into three scalars, put everything after "$field2" into $re +st: ( $field1, $field2, $rest ) = split( /$separators/, $input_string, 3 + );
Bear in mind that something like the following would be a mistake, since the first array will take up all the results from split, and any subsequent variable(s) will be empty (undef):
# wrong: ( @fields, $comment ) = split( /[\t#]/, $input_string );

In reply to Re: Misprocessed Read From Files? by graff
in thread Misprocessed Read From Files? by Napa

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.