Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

petdance
  andy@petdance.com
http://www.perlbuzz.com/
AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)
Jabber: petdance@gmail.com

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Thursday July 20, 2006
01:33 AM

Having Makefile.PL ignore symlinks

[ #30351 ]
In my maintenance of Perl::Critic::Bangs, it's a big PITA (as opposed to PITA) to type in filenames like lib/Perl/Critic/Policy/Bangs/ProhibitStupidCode.pm all the time, so I created symlinks to them in my root directory. Problem is that Makefile.PL thinks that they're part of the distro.

Solution: Override the method libscan() and have it return an empty space if the file is a symlink.

package MY;
sub MY::libscan {
    my $self = shift;
    my $path = shift;

    $path = $self->SUPER::libscan($path);

    # I have a bunch of symlinks in the root.  Ignore them.
    return '' if -l $path;
    return $path;
};

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.