Editing a large module and you want to run/compile
just a sub-section. Add #!perl and '__END__' around
the interesting bit and run it with perl -x
Vim ':make' integration is an exercise for the interested
reader.
In MyFile.pm
half-baked pseudo-code
#!perl -wl -MData::Dumper
sub hohum {
return bless {}, 'Something::Interesting';
}
print Dumper(hohum);
__END__
more bad code
Then at the command line:
$ perl -x -Mstrict MyFile.pm
or
$ perl -cx -Mstrict MyFile.pm
or even
$ perl -x -MO=Deparse MyFile.pm
PS. Riddle me this Batman:
$ perl -x
#!perl -MYAML -Mstrict
"-Mstrict" is not exported by the YAML module at - line 0
Can't continue after import errors at - line 0
BEGIN failed--compilation aborted.
Update: Changed -mstrict to -Mstrict per tye