Sorry... I changed the "user interface" on the script without telling you. The version you originally posted had a specific path hard-coded for "$rootdir", but in order for me to try it out myself (without a windows system or the specific directory path you used), I made it so that the "$rootdir" comes from a command-line argument (given to the script via @ARGV).
So my version requires exactly one command-line arg (@ARGV==1) and this arg must represent a reachable directory path (-d $ARGV[0]), or else the script dies and tells you what it needs in order to run (Usage: {name_of_script} path_name). That's just a typical unix-style CLI.
To go back to your own hard-coded value for $rootdir, just comment out that @ARGV line and the one after it, then add in your single line that assigns a specific path string to $rootdir.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.