in reply to Dangers of require 'file.pl'

If you're requiring a file that defines a package, then it should be a ".pm" file, and you can just, e.g., require packagename without the ".pm" (and without any quotes around the package name), and this use of require is "acceptable."

Replies are listed 'Best First'.
Re^2: Dangers of require 'file.pl'
by sapphirecat (Acolyte) on Feb 25, 2011 at 18:32 UTC

    I see--in that case you end up with the same 'restrictions' as use packagename, which lead to the same benefits of robustness and nestability.

    "Basically, displaying invisible data is not maintainable."

      This was the way to import code prior to the invention of Perl modules (Perl 5?). Anyway, this use of require is obsolete now. It's not much more than an eval of some external code.

      --marmot