LanX has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I tested on two different installations that the debugger is activating a bunch of features when using it interactively.

I suppose it's doing a use VERSION internally activating features

It's kind of surprising because I provided a -e and not a -E in the prompt.

Is this documented behavior and if not shouldn't it be?

~$ perl -de0 Loading DB routines from perl5db.pl version 1.77 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): 0 DB<1> p $] 5.038002 DB<2> use B::Deparse DB<3> p B::Deparse->new->coderef2text(sub{}) { use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'isa', 'm +odule_true', 'postderef_qq', 'say', 'signatures', 'state', 'unicode_s +trings', 'unicode_eval'; } DB<4>

See also Re^12: converting binary to decimal

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

Replies are listed 'Best First'.
Re: Perl debugger is interactively using features
by ikegami (Patriarch) on Jun 10, 2025 at 18:39 UTC

    It's the result of the following in perl5db.pl:

    BEGIN { require feature; $^V =~ /^v(\d+\.\d+)/; feature->import(":$1"); $_initial_cwd = Cwd::getcwd(); }

    (On a side note, it's pretty silly you can't do use feature $^V;.)

      Do you know since which version this is in the code?

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

Re: Perl debugger is interactively using features
by LanX (Saint) on Jun 11, 2025 at 11:23 UTC
    I just checked again:

    perldebug mentions the word "interactive" 13 times but never "features"

    • Shouldn't this interactive feature be documented?
    The -E commandline switch (capital E) was added in 5.10.
    • Shouldn't the debugger's rather depend on the -e or -E switch?
    Thanks.

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