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


in reply to Reading from <DATA> in import/BEGIN block

You can use INIT { } block for your purposes

see perldoc perlmod about INIT construct

Update sorry, I missed something.