http://www.perlmonks.org?node_id=1229192


in reply to Assignment and use statement in the same BEGIN block

A use within a BEGIN is effectively a BEGIN within a BEGIN.

This should work:

perl -wE'BEGIN { $vars{k} = "v1"; require Acme::PERLANCAR::DumpImportA +rgs; import Acme::PERLANCAR::DumpImportArgs %vars }'