Hi, I am a newbee to PERL

Indeed! In fact, s/PERL/(qw|P p|)[rand 2].'erl'/ge - but not "PERL". And I also think s/(?<=newb)ee/ie/g - but I'm not a native English speaker...

so can you please explain me what this tool is doing with what are the parameters

The docs will explain it to you far better than I ever could. I didn't use anything exotic so that should be straightforward. If you encounter any specific difficulty, then do not exitate to ask for further clarifications.

I have actually tried this with c:\directoryname but it gives everything in that directory as well as in subdirectories.

Indeed this was noted by ikegami here. Incidentally this is my response to him.

Is there any way to mention depth

You can:

What I mean is, if I give c:\temp, it should only show me the directories and files in that directory and not under the its subdirectories.

As also noted by ikegami in the same post as above, your UI syntax is somewhat odd. But if you really want to go with that, then just do something along the lines of the following:

die "Too bad!\n" unless @ARGV; for (shift) { if (/\*$/) { find { ... }, glob; } else { die "`$_': not a directory!\n" unless -d; my @files=glob "$_/*"; # ... } }

Here I used glob because I find it to be appropriate in most cases, YMMV may vary of course, and like many others you may prefer to opendir and readdir instead.

Also notice that I used a for loop for the sole purpose of aliasing $_, which is a practice that many people don't like. But I do, so bear with me! I may have used local $_=shift instead.


In reply to Re^5: To retrieve all files according to given path list by blazar
in thread To retrieve all files according to given path list by devlele

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.