Not sure what your problem is with this, but you might find the following code a little cleaner:
foreach $file ($afile, $bfile, $cfile, $dfile) { if (defined $file) { &parse_recent; &parse_monthly; &parse_new; &create_temp_a; &copy_new_to_recent; &copy_recent_to_monthly; &remove_excess; &done; } }
Other than needless duplication, your code is fine. My only concern would be the &subname syntax. When calling a sub with and ampersand prefix and not passing any arguments, the current value of @_ is passed to the sub. This is useful if you are calling subs from subs and need to keep the original passed parameters.

The danger is, if you're not aware of this and you have something in your @_ array, calling a sub this way may generate unexpected results. You're calling many subs with this syntax and if any of them are doing something unusual if the @_ array is empty, you may have a problem.

Here's an example:

&sub1("Good"); sub sub1 { &sub2; } sub sub2 { my $var = shift; print "We're having an argument: $var.\n" if defined $var; }
Guess what? It prints "We're having an argument: Good." even though casual examination suggests that no argument was passed. It's safer to call the sub as subname() or simply call it with a bare subname (which I wouldn't suggest as that means you aren't using strict.

Other than that, nothing more to offer. Give us more detail on your problem and we'll try to help.

Cheers,
Ovid


In reply to (Ovid) Re: is this correct? by Ovid
in thread is this correct? by damian

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.