in reply to Re: Adjusting variable context when workign with JSON data?
in thread Adjusting variable context when workign with JSON data?

capturex from core module IPC::System::Simple would be a simpler replacement for backticks.

Replies are listed 'Best First'.
Re^3: Adjusting variable context when workign with JSON data?
by karlgoethebier (Abbot) on Dec 05, 2024 at 10:24 UTC

      IPC::System::Simple is used by use autodie qw( system );, so it's bundled with Perl since autodie's creation in 5.10.1, and I suspect it was written for it.

        Turns out IPC::System::Simple ISN'T a core modure, even though it's used by core module autodie. use autodie qw( system ); fails if IPC::System::Simple isn't installed.

        $ perl -e'use autodie qw( system );' IPC::System::Simple required for Fatalised/autodying system() at -e li +ne 1 BEGIN failed--compilation aborted at -e line 1.

        That's why use autodie; aka use autodie qw( :default ); doesn't include use autodie qw( system );.

        That's a huge wtf, especially considering the usefulness of what the module provides: It provides alternatives to questionably-designed builtin functions.

      instead of outdated, I prefer to be called retro 😉