I'm sorry. I should explain what's going on behind the scene:

When you surround your filename expression (actually, a scalar holding the filename) with '<' and '>', what you get is a file glob. That's the name of this use of '<' and '>' surrounding a scalar designing a filename or something that looks like a file name set (think on it as the equivalent of using dir *.txt on the old D.O.S.).

File globbing is used to do strange (not that strange, indeed) things with sets of filenames.

The strange behavior of your script was because the file name globbing was working when you didin't like it to.

Maybe I should rewrite this comment, I feel that it may confuse you. If it do so, please let me know and I will try to fix it up

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Just Another Perl Monk


In reply to Re: Re: Re: Overwrite file protection by monsieur_champs
in thread Overwrite file protection by Willman023

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.