Begin - Run arbitrary code before your script starts


Begin documentation  | view source Contained in the Begin distribution.

Index


NAME

Top

Begin - Run arbitrary code before your script starts

SYNOPSIS

Top

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

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

DESCRIPTION

Top

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

Top

perlrun

COPYRIGHT AND LICENSE

Top


Begin documentation  | view source Contained in the Begin distribution.