Your problem is in the
  next if (($_ != m/^\.+$/) || ($_ != m/^ws\_ftp/i));
line. Get rid of the "$_ !=" in each of them.

The reason for this has to do with Perl numeric conversion of strings. I believe that what it is doing is applying the match, getting back either a 1 (true) or "" (false). The 1 is a one, no problem in converting it there, but the "" converts to 0.

Then when it converts your file name (and it does this due to the !=, a numeric operation) "1234.ppt" it gets back 1234, which will not match either a 1 or a 0. For files that don't start with numbers, you're not having the problem because they're all converting to 0.

I'm a little surprised you haven't gotten any filenames that start with ws_ftp, though. It seems like you should be getting some bad filenames as well as having the others omitted.


In reply to Re: Fetdching filenames starting numbers. by Anonymous Monk
in thread Fetdching filenames starting numbers. by Anonymous Monk

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.