NAME

Begin - Run arbitrary code before your script starts

SYNOPSIS

perl -MBegin='print "hello world\n"' script.pl

perl -MBegin='$debug = 1' script.pl

DESCRIPTION

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

SEE ALSO

perlrun

COPYRIGHT AND LICENSE

Copyright (C) 2008 by Salvador Fandiño (sfandino@yahoo.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.