in reply to Re: Best way to call another perl file
in thread Best way to call another perl file

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 :)

  • Comment on Re^2: Best way to call another perl file

Replies are listed 'Best First'.
Re^3: Best way to call another perl file
by karlgoethebier (Abbot) on Apr 02, 2015 at 17:50 UTC
    "... 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