* James E Keenan ([EMAIL PROTECTED]) wrote:
> and in the corresponding /blib/lib directory.  Of course, I expected it 
> to be here as a residue from its installation ... but I expected it to 
> be in some 'lib' directory as well.
> 
> Can anyone clue me in?

I have a handy script I keep in my ~/bin directory called 'pmpath'

    #!/usr/bin/perl 
    $module = shift;
    ($mod = $module) =~ s#::#/#g;
    die ("Need a module name\n") unless $mod;
    $mod .= '.pm';
    require $mod;
    print $INC{$mod} . " (" . ${$module . "::VERSION"} . ")\n";

Which I run like this

    [EMAIL PROTECTED]:~$ pmpath Devel::Cover
    /Library/Perl/5.8.1/darwin-thread-multi-2level/Devel/Cover.pm (0.50)

Yes I know "perldoc" does this for you, but it doesn't give you the
$VERSION :)   This is very handy when you login for to a system for the
first time and you need to get an idea how up to date it is.

I also have another handy script called 'pmlocal'

    #!/usr/bin/perl 
    use strict;
    use warnings;
    use File::Path qw(mkpath);
    use File::Copy qw(copy);;

    my $editor = $ENV{EDITOR} || 'vi';
    my $module = shift;
    die ("Need a module name\n") unless $module;

    $module =~ s#::#/#g;
    $module .= '.pm';
    require $module;
    my ($path) = $module =~ /(.+)\//;

    mkpath($path,1);
    copy($INC{$module},$module);
    exec("$editor $module");

That will make a local copy of the code in question and open it an
editor so I can hack away :)  Most of the time when you do want to "use
the source" you might want turn their debug on or put some debug
statements of your own in.

-- Jeff Bisbee / [EMAIL PROTECTED] / jbisbee.com

Reply via email to