in reply to Running modulino inside BEGIN

Are you not able to alter the behavior of F5 to run an arbitrary perl script?

This seems like a situation I'm having with a co-worker who insists on starting every .pm with

use Cwd (); use lib Cwd::abs_path(__FILE__) =~ s{/@{[__PACKAGE__ =~ s{::}{/}gr] +}\.pm$}{}r; use lib Cwd::abs_path(__FILE__) =~ s{lib/@{[__PACKAGE__ =~ s{::}{/}gr] +}\.pm$}{Schema/lib}r;
so that he can run perl -c on the file and have it find all its modules. He seems resistant to just have the compile-check run a more advanced script that initializes the library path for him.

Replies are listed 'Best First'.
Re^2: Running modulino inside BEGIN
by LanX (Saint) on Apr 14, 2024 at 21:08 UTC
    > you not able to alter the behavior of F5 to run an arbitrary

    Sure, I can either redefine F5 or setup another key for testing, or even set a config-line at the top of the module redefining F5 only for this file.

    I prefer a Perl solution which is editor agnostic.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery