in reply to Passing package/module names to script as argument

you can tell Perl to import modules in the command line

X:\>perl -MData::Dump=pp -e"pp [1..3]" [1, 2, 3]

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: Passing package/module names to script as argument
by dsheroh (Monsignor) on Sep 14, 2018 at 07:29 UTC
    True, but that doesn't provide a list of the extra modules to the program. (Unless you go looking through %INC, but then you have to filter out all the other modules the program has loaded in addition to the ones named in the -M arguments.)