Tired of scrambling around @INC when you want to see a module's code? Let Perl find it!
Save this in a file in your search path (I called it vipm -- guess what editor I use). Then you can just say
or whatever.vipm Apache::Registry CGI #or vipm Apache/Registry.pm CGI.pm
Arguments starting with - are passed through. There's not a lot of error checking; give it stupid arguments, it'll probably do stupid things.
Share and enjoy.
#! /usr/bin/perl -w # # Find a module and edit it. Arguments should be either # "Perl" style: Apache::Registry # or "path" style: Apache/Registry.pm # # Any arguments starting with - are passed to editor unchanged. # foreach (@ARGV) { next if /^-/; s|/|::|g if s/\.pm$//; eval "require $_" or die "Module $_ didn't load\n"; s|::|/|g; } exec $ENV{EDITOR} || '/bin/vi', map {/^-/? $_ : $INC{$_ . '.pm'} } @AR +GV;
In reply to Find and edit module by VSarkiss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |