Each module requires a separate command install:
perl -MCPAN -e 'install DBIx::Transaction; install File::Basename::Object'
If you want to simplify the installation process even further, look for cpanmone that does not require any configuration and will install modules by default without a hint.
You can install both modules with one command cpanmas follows:
cpanm DBIx::Transaction File::Basename::Object
, , , , , perl .