I have a project that I've done in perl script. It's a bunch of simple scripts that parse up csv files in different formats and put selected data from them into a common table. I've expanded these individual scripts and have at least one section that is common to all. For the time being, it's better to keep the scripts separate.

What I'd like to do however is take that common section out of all the scripts, put it in it's own script so that it can just be called by the others. This section however must return an array of filenames to the "parent" script. Is this possible in perl?

I know in PHP you just do an include(scriptname) but I don't know how to accomplish this in perl.

thanks,

jeff


In reply to Using php like includes in perl script? by singlespeed

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.