#!/usr/bin/perl use File::Spec::Functions qw(:ALL); $ARGV[0] or die "usage: $0 Module::Name\n"; my $subpath = catfile(split '::', $ARGV[0]).".pm"; for(@INC) { my $fullpath = catfile($_, $subpath); print("$fullpath\n"), exit if -f $fullpath; } die +(splitdir $0)[-1] . ": no such module $subpath\n";