I've got a simple perl script where I am looping thru a directory and for each file I am 1) parsing the file, and 2)moving the file elsewhere. The parsing and moving subroutines are in external files. Independently they each work, but when I call one after the other, the parse works, and the move doesn't. It also only cycles thru one file in the directory. I'm thinnking this has to do with how the first subroutine (parsing returns). I've got some code snippets below - can someone help me figure out what I'm doing wrong?

Main file:

use Parse; # my custom Parse.pm in /etc/perl/ use Moving; # my custom Moving.pm in /etc/perl ..... foreach $file (@filelist) { Parse::parse_file($file); Moving::move_file($file); .....

In Parse.pm, it parses the file - at the very end of the function I have a "return 1" to indicate success.

Somehow it is never getting to Moving.pm, so I"m thinking it must have something to do with the return from Parse.pm - ?? does anyone have any suggestions? thanks-


In reply to return from external subroutine by kathys39

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.