if i have $afile, $bfile defined it does not proccess $bfile

damian: we don't have enough information here to tell you what's going on. On the surface, your code should work. Are you getting any error messages or is your code silently going along and doing stuff without complaining? If you're not getting error messages, I suggest four courses of action:

  1. Go over your subs and see if your setting any global vars that you use as conditionals. If so, the next time you encounter them, your subs may see them and not execute desired code.
  2. Read Using the Perl Debugger and try it out on your code. It's a bit more work up front, but I guarantee that the debugger will become one your best friends in the future.
  3. Verify the you are checking the return codes whenever you open or close a file. For example: open FILE, $file or die "Can't open $file: $!\n". That $! will hold your error code. If you don't check the return codes, you will have no idea whether or not your file manipulations worked.
  4. And for last, here's my guess as to your problem: I suspect for your code that if $bfile is defined that your sub such as &parse_recent and &parse_monthly are supposed to act on $bfile. However, it's not clear from your code how you are passing the appropriate file to the subs. Are they just acting on $afile all the time?
Hope this helps.

Cheers,
Ovid


In reply to (Ovid) RE(3): 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.