I hope I can explain this right.

I wish you could have, but... You seem to focus on the condition that causes this error message:

Duplicate Section Name: (some_parameter_string) Delete from UNIX command line.

Go To the Miscellaneous link and click the 'Remove whitelist lock'

and you seem to think this has something to do with file locking. But there is nothing in the code provided that has anything to do with file locking. Your "seive_until_remove_filter" sub has an array called "@lock" and a variable called $filelock, but these appear to contain FTP host names, because your code goes like this:

sub seive_until_remove_filter { my ($relay, $relay_dir, $filename, $home_dir, @lock) = @_; ... foreach my $filelock ( @lock ) { ... if ( my $ftp = Net::FTP->new($filelock)) { ... ## delete some "flag" file(s) from some path } else { sieve_util_generic_error ("Unable to login to $relay."); } ...

Could it be you're just using the wrong variable as the ftp host to connect to? What file is it that's getting truncated -- one that is specifically opened in the code shown, or some other file whose name is passed around in one of the parameter strings?

Maybe you'd better start from first principles. What is this app supposed to do? What conditions are in place when it begins, what user input/decisions are required to make it work, and how are conditions different when it's done? What are the specific boundary conditions or exceptions that will alter its behavior and results? Which of those is causing the trouble?

Try running it from the command line with "perl -d" to step through the conditional block and/or sub that is supposed to handle the problem case, and check whether the relevant variables have the values you expect, whether the conditionals are evaluating the way you intend, etc. If you've been "looking at this code for a few days" without using the debugger to step through it, you're wasting your time.


In reply to Re: Need help! Data in file getting deleted by graff
in thread Need help! Data in file getting deleted by mr_evans2u

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.