kathys39 has asked for the wisdom of the Perl Monks concerning the following question:
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-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: return from external subroutine
by moritz (Cardinal) on Aug 23, 2007 at 15:18 UTC | |
|
Re: return from external subroutine
by starX (Chaplain) on Aug 23, 2007 at 15:27 UTC | |
by kathys39 (Acolyte) on Aug 23, 2007 at 15:57 UTC | |
by starX (Chaplain) on Aug 23, 2007 at 16:16 UTC | |
by CountZero (Bishop) on Aug 23, 2007 at 20:33 UTC | |
by chromatic (Archbishop) on Aug 24, 2007 at 07:34 UTC | |
by CountZero (Bishop) on Aug 24, 2007 at 12:18 UTC | |
| |
|
Re: return from external subroutine
by jbert (Priest) on Aug 23, 2007 at 16:22 UTC | |
by kathys39 (Acolyte) on Aug 23, 2007 at 17:08 UTC | |
by moritz (Cardinal) on Aug 24, 2007 at 07:14 UTC | |
by kathys39 (Acolyte) on Aug 24, 2007 at 12:05 UTC | |
by hilitai (Monk) on Aug 23, 2007 at 18:21 UTC |