in reply to Best way to call another perl file

> each of the called files will need to be supplied with dynamic arguments and need to either create a PDF file and pass back the filename

For an easy approach have a look at do FILE , this reads and evals another file in the same context, i.e. as if inserted in code.

The "best" approach is using modules, but this requires more preparation.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)

PS: Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Best way to call another perl file
by Anonymous Monk on Apr 02, 2015 at 01:09 UTC

    The "best" approach is using modules, but this requires more preparation.

    more? All the options are about equal amount of preparation ... name subs, name files ... name package ... about equal effort (save extra 100 keystrokes here there)

    zentara package/module tutorial

    FWIW, among all the options available, do is about the worst :)

      "... do is about the worst"

      It seems to be an ineradicable prejudice that do $file and its equivalent eval qx(cat $file) is bad practice.

      It seems to be an ineradicable prejudice that do $file and its equivalent eval qx(cat $file) is bad practice per se.

      Anyway, for some details about the pro and cons recipe 8.16. in the Perl Cookbook is still a good source.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        It seems to be an ineradicable prejudice that do $file and its equivalent eval qx(cat $file) is bad practice.

        Hmm, lets see, do documentation itself tells you use/require are better ... meaning actual modules are better ... most folks who do 'file'; manage to forget about namespaces and aren't coping with scoping -- when they switch to use/require they're at least forced to think about it by all the tutorials