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
In MyFile.pm
Vim ':make' integration is an exercise for the interested reader.
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.pmPS. Riddle me this Batman:
Update: Changed -mstrict to -Mstrict per tye$ 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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl -x to test while developing (riddles)
by tye (Sage) on Apr 29, 2003 at 05:08 UTC | |
by bsb (Priest) on Apr 29, 2003 at 06:06 UTC | |
by Aristotle (Chancellor) on Apr 30, 2003 at 12:59 UTC |
Back to
Cool Uses for Perl