our $FORMAT = '%Y%m%d%H%M%S' if(! defined $FORMAT);

uses questionable scoping. It would definitely be an error if my was used instead of our. It would be better as

our $FORMAT; $FORMAT = '%Y%m%d%H%M%S' if(! defined $FORMAT);

It's also very poor to use a global variable as a parameter.

But that's off topic.

I'm not actually going to go on topic since I can't trust any of your code. You obviously didn't run it or you'd have \n (the two character, not a newline) in your output.

Update: Oh boy did I call it! Given what the OP said in his reply, the code he said worked couldn't possibly have worked (even on a case-insensitive file system). Don't lie to us by telling us code works when it has never been run.


In reply to Re: perl our scoping from packages by ikegami
in thread perl our scoping from packages by netrom

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.