Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
You would do well to read some of the literature on posting questions on help forums effectively. See, for example, I know what I mean. Why don't you?, How (Not) To Ask A Question, How do I post a question effectively? or How To Ask Questions The Smart Way.

When you directly interpolate your name into your string, it's like you literally typed that on the command line. If file names contain whitespace or shell meta characters, then the literally-interpolated string will mean something other than you intend. The solution is to use techniques other than direct interpolation -- there are a number of ways to get Perl to do the heavy lifting for you. I posted one such solution in Re: Using wildcards to open files.. What doesn't work about it? Have you even tried it?

I'm guessing that this is a Windows system since the solution posted would have worked otherwise. The Windows command line does not escape the same way that most systems do. In particular, it does not read "\ " as an in-name space. What you need to do for a MS system is wrap the name in double quotes, like $cmd = qq{perl < "$file"};

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

In reply to Re^5: Using wildcards to open files. by kennethk
in thread Using wildcards to open files. by starface245

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (2)
    As of 2018-01-22 10:42 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (233 votes). Check out past polls.