Last Updated: February 25, 2016
·
1.256K
· ksi

Check location of / edit installed perl module

Add the function to your bash-profile:

function perlwhere {
    lib=${1//::/\/}
    file=$(perl -e "use $1; printf(\"%s\n\", \$INC{'$lib.pm'} )";)
    echo $file;
}

and run

perlwhere List::Util

Smarter:
Add the function to your bash-profile:

function perledit {
    file=$(perlwhere $1)
    if [ -n "$file" ]; then
        subl "$file"
    fi
}

And run

perledit List::Util

to read / edit the file right in place.