Begin - Run arbitrary code before your script starts
perl -MBegin='print "hello world\n"' script.pl perl -MBegin='$debug = 1' script.pl
This module effectively allows to inject arbitrary code from the command line before running any perl script.
It can be used to set global variables.
I find it also useful when running the perl debugger as a REPL to test things. For instance:
perl -MBegin='$ssh=Net::OpenSSH->new(host)' -de 1
Copyright (C) 2008 by Salvador Fandiño (email@example.com)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.