Made the following changes:

  1. Added strict to aid in debugging;
  2. Slight reformat for readability:
  3. #!/usr/bin/perl use strict; $moyr="12/2014"; $,=" "; open(IN,"<COS_SGA_xref.txt"); while(<IN>) { chop; @_ = split(/ /); $csga{$_[0]}=$_[1]; } open(IN,"<cc.txt"); open(OUT,">new_cc.txt"); for($i=0;$i<9;$i++) {$_=<IN>;} ($mo,$yr)=@_ = split(/\//,$moyr); while(<IN>) { chop; @_ = split(/ /); $created=pop(@_); ($mocr,$day,$yrcr)=@_ = split(/\//,$created); if($yrcr.$mocr >= $yr.$mo) { $cc=$_[1]; $cc =~ y/C_//d; splice(@_,3,1); shift(@_); print OUT $created,@_,$csga{$cc}; print OUT "\n"; } } __END__

    Now for the errors:

    D:\PerlMonks>test1.pl Global symbol "$moyr" requires explicit package name at D:\PerlMonks\t +est1.pl line 5. Global symbol "%csga" requires explicit package name at D:\PerlMonks\t +est1.pl line 11. Global symbol "$i" requires explicit package name at D:\PerlMonks\test +1.pl line 15. Global symbol "$i" requires explicit package name at D:\PerlMonks\test +1.pl line 15. Global symbol "$i" requires explicit package name at D:\PerlMonks\test +1.pl line 15. Global symbol "$mo" requires explicit package name at D:\PerlMonks\tes +t1.pl line 16. Global symbol "$yr" requires explicit package name at D:\PerlMonks\tes +t1.pl line 16. Global symbol "$moyr" requires explicit package name at D:\PerlMonks\t +est1.pl line 16. Global symbol "$created" requires explicit package name at D:\PerlMonk +s\test1.pl line 20. Global symbol "$mocr" requires explicit package name at D:\PerlMonks\t +est1.pl line 21. Global symbol "$day" requires explicit package name at D:\PerlMonks\te +st1.pl line 21. Global symbol "$yrcr" requires explicit package name at D:\PerlMonks\t +est1.pl line 21. Global symbol "$created" requires explicit package name at D:\PerlMonk +s\test1.pl line 21. Global symbol "$yrcr" requires explicit package name at D:\PerlMonks\t +est1.pl line 22. Global symbol "$mocr" requires explicit package name at D:\PerlMonks\t +est1.pl line 22. Global symbol "$yr" requires explicit package name at D:\PerlMonks\tes +t1.pl line 22. Global symbol "$mo" requires explicit package name at D:\PerlMonks\tes +t1.pl line 22. Global symbol "$cc" requires explicit package name at D:\PerlMonks\tes +t1.pl line 23. Global symbol "$cc" requires explicit package name at D:\PerlMonks\tes +t1.pl line 24. Global symbol "$created" requires explicit package name at D:\PerlMonk +s\test1.pl line 27. Global symbol "%csga" requires explicit package name at D:\PerlMonks\t +est1.pl line 27. Global symbol "$cc" requires explicit package name at D:\PerlMonks\tes +t1.pl line 27. Execution of D:\PerlMonks\test1.pl aborted due to compilation errors. D:\PerlMonks>

    I will start debugging this, but you should also.
    Holler if the above error messages don't make sense to you.


    In reply to Re: script assistance please by marinersk
    in thread script assistance please by perlnobie

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  4. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  5. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  6. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  7. Please read these before you post! —
  8. 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
  9. 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;
  10. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  11. See Writeup Formatting Tips and other pages linked from there for more info.