This may be slightly off topic, it sounds to me you're creating something similar to a MANIFEST file. Let me explain what this is..

On CPAN, every module has a file in it called MANIFEST. It's become a standard part of most perl module distributions. Basically, it's is a list of all the files in the current (and lower directories), along with optional comments beside each file name. It's main purpose is to be a module-wide database of required files, so that during install, any missing files will immediately raise errors from the install process.

There is a module called ExtUtils::Manifest, which is part of the standard perl distribution, that takes care of reading the current directory, and creating a MANIFEST file for you. As well, inside a file called MANIFEST.SKIP, you can specify a list of regexes that match file names to skip.

While it's interface it's very elegant, it is functional, and may give you ideas if/when you decide to roll your own manifest writer. Here's some simple example code that will create a MANIFEST with the current directories' contents inside it:

#!/usr/bin/perl -w use ExtUtils::Manifest qw(mkmanifest); #Optional Configuration $ExtUtils::Manifest::Quiet = 1; #Turn off warnings $ExtUtils::Manifest::Verbose = 0; #Turn off status updates $ExtUtils::Manifest::MANIFEST = 'MANIFEST'; #Filename to write #Will make a MANIFEST file for all the files in your #current directory, including the MANIFEST file mkmanifest();

In reply to Re: Re: get contents of directory by dkubb
in thread get contents of directory 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.